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
about 7 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.
S
Saul Macht
said
about 7 years ago
I'm attaching my debugging screenshots for your reference.
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
about 7 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.
Saul Macht
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!
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.
Saul Macht
I'm attaching my debugging screenshots for your reference.
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.
Bryan Yap
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.