HTTP Request Activity - Differenct Status Code Error

I have website which I when Fire in the browser (firefox) returns a error code 401, as you can see in the below screenshot

But when I fire the the same website from the http request activity it returns an error code 406 which I am not aware of, and I am not able to figure why it is returning it like that, as you can see in the below screenshot

image

Does anybody have any idea on this ?

So we would suggest checking how was the HTTP request configured e.g.

Hi @Ishan_Shelke,
As @ppr has mentioned, 406 implies that the HTTP headers are incorrect, impying that the Headers used when FireFox is hitting the URL is different from the Headers that you are setting in your project.
Follow this to get the HTTP Headers from your FireFox - In Firefox, how do I see HTTP request headers? (where in web console?) - Stack Overflow

If you want to accommodate the 401 error in your project, then set the same headers that is being sent in the FireFox request.

Let me know if this helps

Thanks,
Nishant

AcceptFormat - The format in which to receive the web server’s response. The following options are supported: ANY - the default value, XML , JSON , and CUSTOM . When choosing the CUSTOM AcceptFormat, if an Accept or accept Header parameter is present, then it will be sent as the custom accept format. If no header parameter is set, accept will get the RestSharp default value: application/json, application/xml, text/json, text/x-json, text/javascript, text/xml

Reference: https://docs.uipath.com/activities/docs/http-client#input

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