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
| import httplib | |
| import xml.dom.minidom | |
| HOST = "www.domain.nl" | |
| API_URL = "/api/url" | |
| def do_request(xml_location): | |
| """HTTP XML Post request""" | |
| request = open(xml_location, "r").read() |
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
| import urllib2 | |
| from base64 import b64encode | |
| request = urllib2.Request('https://api.xxxx.com/user') | |
| request.add_header('Authorization', 'Basic ' + b64encode('user' + ':' + 'pass')) | |
| r = urllib2.urlopen(request) | |
| print r.getcode() | |
| print r.headers["content-type"] | |
| print r.headers["X-RateLimit-Limit"] |
NewerOlder