diff options
author | David Sansome <me@davidsansome.com> | 2015-06-24 14:27:33 +1000 |
---|---|---|
committer | David Sansome <me@davidsansome.com> | 2015-06-24 14:27:33 +1000 |
commit | 8eac7f9e45fd05e81f8398de9a80d7b3e04a7d77 (patch) | |
tree | 400c754cd465e84640ccfabf45779f352feb7908 | |
parent | f9f797223d075874b0031aea832152688ec23fef (diff) | |
download | httplib2-8eac7f9e45fd05e81f8398de9a80d7b3e04a7d77.tar.gz |
Minor fixes to indentation in the README
-rw-r--r-- | README.md | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -58,9 +58,9 @@ Usage A simple retrieval: ```python - import httplib2 - h = httplib2.Http(".cache") - (resp_headers, content) = h.request("http://example.org/", "GET") +import httplib2 +h = httplib2.Http(".cache") +(resp_headers, content) = h.request("http://example.org/", "GET") ``` The 'content' is the content retrieved from the URL. The content @@ -69,22 +69,22 @@ is already decompressed or unzipped if necessary. To PUT some content to a server that uses SSL and Basic authentication: ```python - import httplib2 - h = httplib2.Http(".cache") - h.add_credentials('name', 'password') - (resp, content) = h.request("https://example.org/chapter/2", +import httplib2 +h = httplib2.Http(".cache") +h.add_credentials('name', 'password') +(resp, content) = h.request("https://example.org/chapter/2", "PUT", body="This is text", headers={'content-type':'text/plain'} ) -``` +``` Use the Cache-Control: header to control how the caching operates. ```python - import httplib2 - h = httplib2.Http(".cache") - (resp, content) = h.request("http://bitworking.org/", "GET") - ... - (resp, content) = h.request("http://bitworking.org/", "GET", +import httplib2 +h = httplib2.Http(".cache") +(resp, content) = h.request("http://bitworking.org/", "GET") +... +(resp, content) = h.request("http://bitworking.org/", "GET", headers={'cache-control':'no-cache'}) ``` |