Does httpClient.post() work with ServiceNow?

Originally asked by Gabor Tavali on 11 September 2020 (original question)


Hey Guys!

I’ve tried to post to a ServiceNow endpoint from Exalate with httpClient but nothing happened and I can’t see any call in the system logs of ServiceNow.

So my question is, does httpClient.post() work in this case?

My code is the following:

httpClient.post("/api/now/table/task_time_worked", "{\"task\":\"1dd598011bcf9850eb92777edc4bcb74\",\"time_in_seconds\":1,\"comments\":\"A\",\"u_start_time\":\"2020-03-1611:00:00\",\"u_type\":\"normal\",\"user\":\"e0c6e02ddb2333007f76af2648961980\"}")

The same endpoint with the same body works with Postman. Furthermore some other ServiceNow GET endpoints work as well from Exalate.

Do you have any idea what can be the problem?

Thank you!


Answer by Francis Martens (Exalate) on 13 September 2020

Can you check in the logging?
The logging is accessible by downloading the exalate support zip. The logfile is accessible there


Comments:

Gabor Tavali commented on 14 September 2020

Hey Francis!

In the log there is nothing about that call. Can I do anything to get more logs?

Juan Grases commented on 15 September 2020

Hi Gabor,

http.post should work on exalate for servicenow yes. When you try this from Postman, were you using the same authentication user as the proxy user you have set up for exalate?

Also, are you hosting exalate for servicenow yourself ? If so, which version of snownode e are you running?

Gabor Tavali commented on 16 September 2020

Hi Juan,

Yes, we use the Exalate proxy user and its password as a basic auth in Postman.

Currently we have a cloud (trial) snownode: https://snownode-paon-ripa-kazi-adar.exalate.cloud/

Gabor Tavali commented on 22 September 2020

Hi Juan Grases ,

In the meantime we have purchased the mentioned snownode so it’s not a trial now.

Unfortunately the problem is the same. Do you have any clue what should we try?

Juan Grases commented on 22 September 2020

Gabor, please open a support ticket (on support.idalko.com) and let’s solve it on a call. I am available today.

Gabor Tavali commented on 22 September 2020

Thank you, it’s done: EASE-5925