• Documentation
  • Workato Blog
  • Product Blog
  • Return to Workato
  • Login
  • Automation Institute
  • Documentation
  • Community Forums
New Topic
Discussions Recipe Building Recipe Error Troubleshooting
S

Saul Macht

started a topic over 5 years ago
Answered

Getting HTTP 406 errors when connecting to an external API

I am trying to get some data from my external API endpoint but I keep getting HTTP 406 errors saying that my request is not acceptable. I've already done extensive troubleshooting on the recipe and double checked that the API endpoint that I am connecting to as well as the HTTP GET request parameters which I am using are correct. Would be awesome if you guys could provide some direction on how I can solve this issue. Thanks!


Best Answer
B
Bryan Yap said over 5 years ago

Hi Saul, the issue is most probably due to the Workato HTTP connector automatically adding in an additional 'Accept' request header to your HTTP GET request. 


When making a HTTP request via the HTTP connector in Workato, the connector will automatically add in an 'Accept' header. This 'Accept' header might either be 'Accept: application/json' or 'Accept: text/plain' based on the pre-specified expected response type of the request. 


Unfortunately, at this point, it is not possible to prevent the HTTP connector from sending the 'Accept' header. However, it is possible to overwrite the default 'Accept' header provided by the connector to make it less restrictive. You may do so by specifying your own 'Accept' header within the request headers field of the HTTP connector. Essentially, the goal is to overwrite the 'Accept: application/json' or 'Accept: text/plain' headers with a less restrictive 'Accept: */*' header.


Please see the screenshot below for more details on how this can be done in the recipe.

image




S

Saul Macht

said over 5 years ago

I'm attaching my debugging screenshots for your reference.

image


As can be seen in the image, I am able to do a successful GET request to the API endpoint by simply specifying the endpoint URL as well as the Authorization header. However, when I specify the same information to the Workato HTTP connector, the recipe fails. This does not make sense to me.

Answer

Bryan Yap

said over 5 years ago

Hi Saul, the issue is most probably due to the Workato HTTP connector automatically adding in an additional 'Accept' request header to your HTTP GET request. 


When making a HTTP request via the HTTP connector in Workato, the connector will automatically add in an 'Accept' header. This 'Accept' header might either be 'Accept: application/json' or 'Accept: text/plain' based on the pre-specified expected response type of the request. 


Unfortunately, at this point, it is not possible to prevent the HTTP connector from sending the 'Accept' header. However, it is possible to overwrite the default 'Accept' header provided by the connector to make it less restrictive. You may do so by specifying your own 'Accept' header within the request headers field of the HTTP connector. Essentially, the goal is to overwrite the 'Accept: application/json' or 'Accept: text/plain' headers with a less restrictive 'Accept: */*' header.


Please see the screenshot below for more details on how this can be done in the recipe.

image




Login to post a comment

Still can't find your solution?

Send us a ticket, we will try our best to assist you with your problem

Documentation
Developer's Library
Tutorials
eBooks
Product Hour
Product Blog
Workato Blog
Product updates
Customer Stories
© Workato 2022   Privacy   Terms   +1 (844) 469-6752
  • Documentation
  • Workato Blog
  • Product Blog
  • Solutions
  • Forums
  • Tickets
  • Log in
  • Return to Workato
Topic views count