Created
June 30, 2013 00:20
-
-
Save curious-eyes/5893237 to your computer and use it in GitHub Desktop.
urllib2 sample sending OPTIONS method.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import urllib2 | |
opener = urllib2.build_opener(urllib2.HTTPHandler) | |
request = urllib2.Request('http://example.com', data='your_put_data') | |
request.add_header('Content-Type', 'your/contenttype') | |
request.get_method = lambda: 'OPTIONS' | |
url = opener.open(request) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment