Forum Stats

  • 3,726,724 Users
  • 2,245,247 Discussions
  • 7,852,371 Comments

Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

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

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

Tagged:
This discussion has been closed.