Skip to content

Instantly share code, notes, and snippets.

@kehr
Created January 17, 2017 07:02
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save kehr/0c282b14bfa35155deff34d3d27f8307 to your computer and use it in GitHub Desktop.
Save kehr/0c282b14bfa35155deff34d3d27f8307 to your computer and use it in GitHub Desktop.
urllib2 send DELETE, PUT request
import urllib2
request = urllib2.Request(uri, data=data)
request.get_method = lambda: 'PUT' # or 'DELETE'
response = urllib2.urlopen(request)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment