pyresttest
pyresttest copied to clipboard
Can't send a body with a PUT request
I've tried to implement a PUT request given below:
- test:
- group: "My Group"
- name: "PUT Test"
- url: {template: '/myapi/$some_id'}
- method: "PUT"
- body: 'name=Some+Name&description=Some+description'
- curl_option_ssl_verifypeer: False
- headers: {Content-Type: application/json}
- expected_status: [202]
and with this format as well,
- test:
- group: "My Group"
- name: "PUT Test"
- url: {template: '/myapi/$some_id'}
- method: "PUT"
- body: '{"name": "Some Name", "description": "Some description"}'
- curl_option_ssl_verifypeer: False
- headers: {Content-Type: application/json}
- expected_status: [202]
But I'm unable to receive a body in my apis, which just gets an empty body. As a result I'm unable to test out PUT endpoints for my app. However, the same format works with POST methods where a body is received.
Yeah me too. Also I've tested with Postman. My backend working well. I think pyresttest has huge problem with PUT method. @svanoort