urllib2 - basic authentication and the put and delete methods

deelan ggg at zzz.it
Fri Jul 8 06:40:21 EDT 2005


news.corp.adobe.com wrote:
(...)
> 
> But despite much searching, I have yet to discover how to then use PUT and 
> DELETE to copy files / delete files on the server.

i believe you have to use httplib for that:
<http://docs.python.org/lib/module-httplib.html>

examples here:
<http://docs.python.org/lib/httplib-examples.html>

basically you pass auth headers whie
using PUT/DELETE verbs:

## untested! ##

headers = {
   "Authorization": authheader # your base 64 str
}
conn.request("PUT", "/your/url/here", body, headers)

HTH,
deelan.

-- 
deelan, #1 fan of adriana lima!
<http://www.deelan.com/>







More information about the Python-list mailing list