Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

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

Deepak_Gupta22Apr 13 2018

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

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on May 11 2018
Added on Apr 13 2018
0 comments
226 views