Forum Stats

  • 3,726,735 Users
  • 2,245,248 Discussions


Howdy, Stranger!

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

Call oracle hcm cloud rest service with space and single quote

PriyaTB Member Posts: 79 Red Ribbon


I need to call hcm rest service  from java. Currently I am using jersey to call the rest service.
I need to call rest service like <hcm-rest-url>/<code class="codeph">resources/latest/emps?q=FirstName like 'Ki%'<br/>

the space gives

Exception in thread "main" java.lang.IllegalArgumentException<br/>  at<br/>  at com.sun.jersey.api.client.Client.resource(<br/>..<br/>Caused by: Illegal character in query at index 93: https://<my-hcm-url>/resources/ like 'Astha'<br/>  at$<br/>  at$Parser.checkChars(<br/>  at$Parser.parseHierarchical(<br/>  at$Parser.parse(<br/>  at<init>(<br/>  at<br/>  ... 3 more

So I tried encoding the url

try { URL = URLEncoder.encode(URL, "UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } 

But this gives me

com.sun.jersey.api.client.ClientHandlerException: java.lang.IllegalArgumentException: URI is not absolute<br/>  at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(<br/>  at com.sun.jersey.api.client.filter.HTTPBasicAuthFilter.handle(<br/>  at com.sun.jersey.api.client.Client.handle(<br/>  at com.sun.jersey.api.client.WebResource.handle(<br/>  at com.sun.jersey.api.client.WebResource.get(<br/>......<br/>Caused by: java.lang.IllegalArgumentException: URI is not absolute<br/>  at<br/>  at com.sun.jersey.client.urlconnection.URLConnectionClientHandler._invoke(<br/>  at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(
This discussion has been closed.