pyresttest icon indicating copy to clipboard operation
pyresttest copied to clipboard

Can't send a body with a PUT request

Open srvxid opened this issue 7 years ago • 1 comments

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.

srvxid avatar Nov 01 '16 19:11 srvxid

Yeah me too. Also I've tested with Postman. My backend working well. I think pyresttest has huge problem with PUT method. @svanoort

mehmetkose avatar Nov 09 '16 12:11 mehmetkose