Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP 406 Not Acceptable Errors #177

Closed
gsaqui opened this issue Dec 2, 2015 · 6 comments
Closed

HTTP 406 Not Acceptable Errors #177

gsaqui opened this issue Dec 2, 2015 · 6 comments

Comments

@gsaqui
Copy link

gsaqui commented Dec 2, 2015

When extending the the Client to send GET requests to /v3/suppression/bounces I am getting 406 Not Acceptable as a response. I see that the python library has added an Accept header. When I've done this to my local copy it seems to fix the problem. If this is the correct solution can you please add it to the lib\Client.php file please?

@brandonmwest
Copy link
Contributor

Hi, are you using Google App Engine? We had an issue but it should be resolved now.

@gsaqui
Copy link
Author

gsaqui commented Dec 2, 2015

No I was running locally and only had the issue when I hit /v3/suppression/bounces. I was able to fix the issue locally with the following line in lib\Client.php:

        $guzzleOption['request.options']['headers'] = array('Authorization' => 'Bearer ' . $this->apiKey, 'Content-Type' => 'application/json', 'Accept' => '*/*');

Notice I added 'Accept' => '*/*' as a header. This seemed to fix the problem.

@brandonmwest
Copy link
Contributor

Ah, gotcha, thanks. We will get that header added.

@brandonmwest brandonmwest reopened this Dec 2, 2015
@thinkingserious
Copy link
Contributor

@gsaqui Fixed with this release v4.0.1

Thanks for bringing this to our attention and providing your fix!

@rajatmasih-web4realty
Copy link

I am using Php CURL method and tried by added Accept header but it won't work at all.I am getting this in response with 406 http status and Sometime it works and sometimes not.
Response : \r\n<title>406 Not Acceptable</title>\r\n\r\n

406 Not Acceptable

\r\n
nginx\r\n\r\n\r\n

@childish-sambino
Copy link
Contributor

@rajatmasih-web4realty Please open a new issue.

@sendgrid sendgrid locked as resolved and limited conversation to collaborators Sep 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants