[ANSWERED]: curl -X command convert to urllib2
Posted: Thu Apr 30, 2015 11:54 am
i have the following curl command that works:
curl http:.... -H "authorization: Token xxx" -X DELETE
I have not been able to incorporate the -X DELETE into a urllib2 call. The authorization is ok. It goes into the header ={ "authorization": "token 1212341234"}.
but the -X DELETE is not in the form "xx:yy"
Any hint how to get this into URLIB2 would be appreciated. I have been searching on the web for several hours, but no luck..
thanks
Karl
curl reference
-X, --request <command>
(HTTP) Specifies a custom request method to use when communicating with the HTTP server. The specified request method will be used instead of the method otherwise used (which defaults to GET). Read the HTTP 1.1 specification for details and explanations. Common additional HTTP requests include PUT and DELETE, but related technologies like WebDAV offers PROPFIND, COPY, MOVE and more. .....
at [urlhttp://curl.haxx.se/docs/manpage.html][/url]
curl http:.... -H "authorization: Token xxx" -X DELETE
I have not been able to incorporate the -X DELETE into a urllib2 call. The authorization is ok. It goes into the header ={ "authorization": "token 1212341234"}.
but the -X DELETE is not in the form "xx:yy"
Any hint how to get this into URLIB2 would be appreciated. I have been searching on the web for several hours, but no luck..
thanks
Karl
curl reference
-X, --request <command>
(HTTP) Specifies a custom request method to use when communicating with the HTTP server. The specified request method will be used instead of the method otherwise used (which defaults to GET). Read the HTTP 1.1 specification for details and explanations. Common additional HTTP requests include PUT and DELETE, but related technologies like WebDAV offers PROPFIND, COPY, MOVE and more. .....
at [urlhttp://curl.haxx.se/docs/manpage.html][/url]