Pylons / webtest

Wraps any WSGI application and makes it easy to send test requests to that application, without starting up an HTTP server.
https://docs.pylonsproject.org/projects/webtest/en/latest/
Other
336 stars 110 forks source link

added get_json method via utils.json_method. #253

Closed Estartu closed 8 months ago

Estartu commented 1 year ago

Some of my API calls put json data via the request body on GET requests. To test these methods I have to use

testapp.request('/api/...', method='GET', body=dumps(dict).encode('UTF-8'))

For all other request methods there is a shortcut with *_json just get is missing.

gawel commented 1 year ago

The RFC disallow that AFAIK. You hava to use a POST/PUT method to send a body