3

I'm trying to call SAP SF API calls using RestAssured in my application. The service is given parameter as top 1 .

RestAssured.baseURI="https://sandbox.api.sap.com/successfactors/odata/v2/PerGlobalInfoCHN?%24top=1";
        RequestSpecification httpPost = RestAssured.given().headers("ApiKey","*key*");

        Response response= httpPost.request(Method.GET);

        String responseBody = response.getBody().asString();
        System.out.println("Response Body is :"+response.getBody().prettyPrint());

The output should be only one top element but I'm getting all the results. When same URL is given in postman , it returns top 1 only. What is the issue here? Do we have to provide top=1 as a parameter in header?

  • did you try $ instead of %24? maybe your encoding with this rest-whatever does not work, because the URL works, but the filter not ... – dotchuZ Feb 09 '20 at 08:49

0 Answers0