Http get illegal characters error

Hi, I am trying to invoke a http get and i am getting following error

Could not run ‘test_2’
com.wm.app.b2b.server.ServiceException: java.io.IOException: Illegal character in query at index 29:url ://abcdef.pkmj.com?{“id”:…

i dont get any error while doing a post but i am not receiving token while using post, instead i am getting a html content of page. Please help , I dont see any special characters in url or in json string.Any help will be much appreciated. thanks in advance :pensive:

1 Like

I believe that you have probably just done an invoke of pub.client:http before the one that is giving you an error.
You need to make sure that you drop all input/outputs from the previous call otherwise it will interfere e.g.

Remember you can always map the output to attribute with different names if you want to keep some values and overlap with successive http invokes.
regards,
John.

1 Like

Thank you for the response, there are no other services, i am just calling http service only.when i dont pass any string i am getting a ok status with html response .I am not receving the acess token, looks like i am accessing the page but was not passing parameters. I am using 9.5 version:
please help

You can’t use the data attribute if you are doing a get, otherwise it will add it to the URL.
In which case the string would have to be encoded with key and “=” i.e.

mj.com?data=%7B%E2%80%9Cid%E2%80%9D%3A%20%221234%22%7D

If doing a post, make sure you include in the headers the expected response type i.e.

“Accept”: “application/json”

Thank you John for your response , The issue is fixed now. I am using http post instead to get the token and i als got my Json incorrect in the beginning.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.