Skip to content

mock-server not accepting file put request #18

@indiauplko

Description

@indiauplko

Hi ,

I believe this mock server has got a lot of potential, I am finding it very useful in testing basic rest calls. I am not able to have a PUT request configured which can accept a file. Getting following error trace:

[E 150204 16:59:19 web:1421] Uncaught exception PUT /xyz/Test%20Company/abcd?rev=173-0554db5b52e7881d09991afd04bab7f2 (9.xxx.xxx.xxx)
HTTPServerRequest(protocol='http', host='9.xxx.xxx.xxx:8888', method='PUT', uri='/usb/Test%20Company/abcd?rev=173-0554db5b52e7881d09991afd04bab7f2', version='HTTP/1.1', remote_ip='9.xxx.xxx.xxx', headers={'Connection': 'Keep-Alive', 'Accept-Encoding': 'gzip,deflate', 'Transfer-Encoding': 'chunked', 'Content-Type': 'text/plain', 'Host': '9.xxx.xxx.xxx:8888', 'User-Agent': 'Apache-HttpClient/4.3 (java 1.5)'})
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/tornado-4.1b2-py2.6-linux-x86_64.egg/tornado/web.py", line 1302, in _stack_context_handle_exception
raise_exc_info((type, value, traceback))
File "/usr/lib/python2.6/site-packages/tornado-4.1b2-py2.6-linux-x86_64.egg/tornado/web.py", line 1489, in wrapper
result = method(self, _args, *_kwargs)
File "/usr/lib/python2.6/site-packages/mock_server-0.3.7-py2.6.egg/mock_server/handlers.py", line 135, in put
self._resolve_request(path, format)
File "/usr/lib/python2.6/site-packages/mock_server-0.3.7-py2.6.egg/mock_server/handlers.py", line 213, in _resolve_request
self.log_request(response)
File "/usr/lib/python2.6/site-packages/mock_server-0.3.7-py2.6.egg/mock_server/handlers.py", line 67, in log_request
"body": unicode(self.request.body),
UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 183: ordinal not in range(128)
[E 150204 16:59:19 web:1825] 500 PUT /xyz/Test%20Company/abcd?rev=173-0554db5b52e7881d09991afd04bab7f2

It would be great if there was a way to accept the file.

Thanks,

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions