How to make HTTP DELETE method using urllib2?

you can do it with httplib:

import httplib 
conn = httplib.HTTPConnection('www.foo.com')
conn.request('PUT', '/myurl', body) 
resp = conn.getresponse()
content = resp.read()

also, check out this question. the accepted answer shows a way to add other methods to urllib2:

import urllib2
opener = urllib2.build_opener(urllib2.HTTPHandler)
request = urllib2.Request('http://example.org', data="your_put_data")
request.add_header('Content-Type', 'your/contenttype')
request.get_method = lambda: 'PUT'
url = opener.open(request)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)