0 Replies Latest reply on Apr 13, 2018 6:31 AM by Deepak_Gupta22

    How to use <,<=,>,>= and <> in REST services from java

    Deepak_Gupta22

      Hi Experts,

      I want to use <,<=,>,>= and <> symbols in REST service URI. Using below URI in java:

      https://Host:Port//hcmCoreApi/resources/11.1.11/emps?onlyData=true&q=HireDate>2009-01-01

       

      But getting below error:

      Error in Rest Connection java.lang.IllegalArgumentException: Illegal character in query at index 105 (which is on > symbol).

       

      Can any one help me to resolve this minor issue.

       

      Using below java code:

      ClientConfig config = new DefaultClientConfig();

      Client client = Client.create(config);

      client.addFilter(new HTTPBasicAuthFilter("USERNAME", "PASSWORD"));

      String endPoint = "https://HOSt:PORT//hcmCoreApi/resources/11.1.11/emps?onlyData=true&q=HireDate>2009-01-01";

      WebResource webResource = client.resource(endPoint);

      WebResource.Builder builder = webResource.accept(MediaType.APPLICATION_JSON);

      builder.header("REST-Framework-Version", "3");

      ClientResponse resp = builder.get(ClientResponse.class);

       

       

      Regards,

      Deepak