-
Notifications
You must be signed in to change notification settings - Fork 8
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
Allow more status codes #334
Conversation
https://tools.ietf.org/html/rfc7231#section-6 so if someone does not respect a standard... then what's next? |
This would make this test fail: https://github.com/php-http/psr7-integration-tests/blob/7c963b64105b259da8f0e08226ce4bc71e5a3b8c/src/ResponseIntegrationTest.php#L71 So I would not do this unless there is some real good reason. And just one site misbehaving is not enough reason to me. |
@Tobion @gmponos In fact, the very reason I have landed on this PR is because I too have a 3rd party integration to complete that returns 7xx statuses. I don't like it but the fact is that Guzzle is preventing me from properly handling errors from the API. Also see guzzle/guzzle#2751 and #349 |
+1, I also have to use a 3rd party API that uses status codes in the 9x range. @Tobion: Any way monkeypatching this or getting around the exception - or at least to get the original response object for the response body and headers? |
Please contact the API provider and tell them to fix their API. It is not an HTTP API if they are returning status codes larger than 599. |
The definition of being an HTTP 1.1 API is the official spec, which does not allow such codes. |
Sadly it won't be fixed anytime soon. :( |
@GrahamCampbell Whilst I agree that it would be great for every API I ever had to work with to follow every standard out there... Bottom line is that this is the Internet and there are developers/companies that do not follow them. My asking of them to 'fix' their API is basically going to go unheard. And even if it didn't I could be waiting months or longer for them to change it. In it's current state, guzzle is overly restrictive and causing problems that could otherwise be worked around. |
@GrahamCampbell: So I tried to extend the existing Response class to use a different status code assertion, |
According to this: symfony/symfony#36823
@Tobion WDYT about it?