-
Notifications
You must be signed in to change notification settings - Fork 110
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
Set 'Accept: application/json' for the TestApp.*_json requests? #151
Comments
It make sens. I've never done that because it may be too restrictive. Also wandering if this can break some existing tests. |
I was wondering about tests as well, especially tests using WebTest (as opposed to WebTest's own test suite). 😕 |
A solution is to release a new major version with "maybe" backward incompatibility. Let's go for it. So I guess we can:
If we do that, it may be useful to add a get_json(accept=XX) Please try to provide tests, docs and a changelog entrie |
Did you mean accept= ? If not, then I have no idea what access= would be. |
Yep, sorry :)
|
Also maybe |
I'm working on a Pyramid app, which exposes a json rest api.
In the functional tests, I'm using WebTest and its
TestApp.*_json()
methods to send json requests.The app looks at (among other things) the
Accept
header, to know what to send back to the client.The various
TestApp.*_json()
methods already set theContent-Type
header toapplication/json
, to tell the server that what is sent is json.It seems to me that they should also set the
Accept
header to tell the server that the answer they expect should be json.Does that make sense?
I'd be happy to send a pull request if you agree to this change.
The text was updated successfully, but these errors were encountered: