Reputation: 3738
Im using the awesome python bottle app as a JSON server.
POST
is working fine but not PUT
I use the following in POST to retrieve the POST'ed data.
data = request.body.getvalue()
if data:
...
Whats the equiv for capturing PUT data?
Secondly, do I use the same --data
option on curl for testing (aside from changing the -X verb from POST
to PUT
curl -X PUT --data '{"key":"value"}' http://myserver.com/1/object/type
Upvotes: 1
Views: 341
Reputation: 18128
Whats the equiv for capturing PUT data?
See if this does the trick:
data = request.body.read()
do I use the same --data option on curl for testing
Yep, that should work.
Upvotes: 3