With karate there is no need to use code your own calls to the rest url as you can use a syntax in the feature file to execute and assert the results of the rest request.
The feature files follow the common Gherkin syntax.
See feature file users.feature
See UsersTest class. This is a Karate Junit 5 test class.
To run the test using maven ...
mvn test