Created
April 10, 2015 17:18
-
-
Save Averroes/1d511ad09a068f0c1327 to your computer and use it in GitHub Desktop.
interacting with http services as a client
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
| # Example of a HEAD request | |
| import requests | |
| resp = requests.head('http://www.python.org/index.html') | |
| status = resp.status_code | |
| last_modified = resp.headers['last-modified'] | |
| content_type = resp.headers['content-type'] | |
| content_length = resp.headers['content-length'] | |
| print(status) | |
| print(last_modified) | |
| print(content_type) | |
| print(content_length) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment