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

Need support to have non-json request body #1

Open
Ragsboss opened this issue Oct 31, 2017 · 2 comments
Open

Need support to have non-json request body #1

Ragsboss opened this issue Oct 31, 2017 · 2 comments

Comments

@Ragsboss
Copy link

We have a request that is expecting a binary data as request body. I'm seeing that Client.raw_request unconditionally attempts json.dumps on the data. Is there a way to get around this or can you fix it?

  File "/Users/rags/aos-cli/lib/python2.7/site-packages/http_test_client.py", line 122, in request
    url, method=method, headers=headers, data=data, **kwargs
  File "/Users/rags/aos-cli/lib/python2.7/site-packages/aos/sdk/client.py", line 269, in raw_request
    return super(Client, self).raw_request(*args, headers=headers, **kwargs)
  File "/Users/rags/aos-cli/lib/python2.7/site-packages/http_test_client.py", line 102, in raw_request
    data = json.dumps(data)
  File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 244, in dumps
    return _default_encoder.encode(obj)
  File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 201, in encode
    return encode_basestring_ascii(o)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xb4 in position 11: invalid start byte
@Ragsboss
Copy link
Author

@maximkulkin any thoughts on this?

@maximkulkin
Copy link
Owner

I’m kind hesitant to add this: the idea of this library is simple client that you can quickly bootstrap your integration testing with. Thus the main focus is at supporting JSON services, not a full featured HTTP client.

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

2 participants