Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Getting Invalid URI error in REST GET method

priyankajailia
Mega Expert

Hey Guys,

I have a third party Rest webservice ,for which I am using GET method. and on test gettin Invalid URI:

java.lang.IllegalArgumentException: Invalid uri 'https://***HOSTNAME***/api/guest/?sort=-id&offset=0&limit=25&calculate_count=false&filter={"username":"test040@test.com"}?username=': Invalid query

  at org.apache.commons.httpclient.HttpMethodBase.<init>(HttpMethodBase.java:222)

  at org.apache.commons.httpclient.methods.GetMethod.<init>(GetMethod.java:89)

  at com.glide.communications.HTTPRequest.get(HTTPRequest.java:55)

  at com.snc.commons.eccprobe.RESTProbe.makeHttpRequest(RESTProbe.java:567)

  at com.snc.commons.eccprobe.RESTProbe.probe(RESTProbe.java:182)

  at com.service_now.mid.probe.ECCProbeProxy.probe(ECCProbeProxy.java:45)

  at com.service_now.mid.probe.AProbe.process(AProbe.java:77)

  at com.snc.commons.eccprobe.AECCProbe.process(AECCProbe.java:82)

  at com.service_now.mid.queue_worker.MIDWorker.process(MIDWorker.java:21)

  at com.service_now.mid.queue_worker.AWorker.runWorker(AWorker.java:119)

  at com.service_now.mid.queue_worker.AWorkerThread.run(AWorkerThread.java:20)

  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

  at java.lang.Thread.run(Thread.java:745)

find_real_file.png

find_real_file.png

but its working fine in SOAP.

Please help me on this where I am wrong.

Regards,

Priya

1 ACCEPTED SOLUTION

Alikutty A
Tera Sage

Hi Priyanka,



It shows an Argument exception error. Instead of passing all variables on the endpoint URL, Can you pass then in HTTP Query Parameters?


find_real_file.png



Thank You


Please Hit Like, Helpful or Correct depending on the impact of response


View solution in original post

2 REPLIES 2

Alikutty A
Tera Sage

Hi Priyanka,



It shows an Argument exception error. Instead of passing all variables on the endpoint URL, Can you pass then in HTTP Query Parameters?


find_real_file.png



Thank You


Please Hit Like, Helpful or Correct depending on the impact of response


You are awesome Alikutty. Thanks for the help. It worked.




find_real_file.png