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

Support requests in text/plain #280

Open
aviskase opened this issue Jun 27, 2018 · 0 comments
Open

Support requests in text/plain #280

aviskase opened this issue Jun 27, 2018 · 0 comments

Comments

@aviskase
Copy link

Currently it isn't possible to send requests in text/plain format, because they are converted to application/json compatible format.

Temporary ugly monkeypatch snippet for those, who use bravado+pytest:

from bravado_core.param import marshal_param

def _marshal_param(param, value, request):
    marshal_param(param, value, request)
    if param.location == 'body' and param.op.consumes == ['text/plain']:
        request['headers']['Content-Type'] = 'text/plain'
        request['data'] = value

monkeypatch.setattr('bravado.client.marshal_param', _marshal_param)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant