I’m trying consume a REST API with the HTTPRequest activity.
I’m able to authenticate via POST, receive a cookie, and also send these back in the next request together with the ApiKey.
However my GET request needs to set the “Accept: application/hal+json” header to work. This is impossible - I only ever get the application/json response. Is this a bug or does someone have any input?
@HareeshMR, the authenticated key (and cookie) aren’t important here, just mentioned as an example that setting cookies work and setting other headers work.
The issue is that to get the correct response from the server, I have to set the header “Accept: application/hal+json”. However, HTTPRequest-activity doesn’t set this correctly, even if other headers work (like “ApiKey” from my example).
It seems to me as if the HTTPRequest-activity has a hardcoded “Accept: application/json” or won’t set the “Accept” header at all.
When I test without the “Accept” header in Postman, I get the same json array response like in UIPath. When I test it with the “Accept: application/hal+json” in Postman, I get the full response that I need also in UIPath.
No, not passing any Content-Type, since it’s a GET there is no content. However the reply isn’t application/json, it’s application/hal+json and I need the whole reply (and it’s from a government provider so I can’t change it there).
Ok, I removed the body format, but it gives the same result.
But when I test this in postman, giving any sort of “Accept: /*” or anything else, I get a json array that is missing data.
When I put “Accept: application/hal+json” I get the full response with all the data that I need. So I have to pass exactly “Accept: application/hal+json” but HTTPRequest doesn’t do this. Is there any way I can make it send this header?