Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danhper/python2-http-wrapper
Basic easy to use HTTP wrapper around urllib for Python2
https://github.com/danhper/python2-http-wrapper
Last synced: about 2 months ago
JSON representation
Basic easy to use HTTP wrapper around urllib for Python2
- Host: GitHub
- URL: https://github.com/danhper/python2-http-wrapper
- Owner: danhper
- License: mit
- Created: 2013-02-22T18:53:55.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-03-09T12:50:30.000Z (almost 12 years ago)
- Last Synced: 2024-04-14T11:08:02.835Z (9 months ago)
- Language: Python
- Size: 117 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# http-wrapper
A very basic HTTP wrapper library around urllib for Python2.
It only has a very limited set of feature compared to httplib but allows to deal easily with pages with 'exotic' encodings.
## Sample usage
#-*- coding: utf-8 -*-
import http
request = http.HTTPRequest("http://dummy.site.com", method="POST", encoding="sjis")
request.set_parameter('foo', 'bar')
request.set_parameter('exotic_encoding', u'utf使おう><') # will encoded in sjis
response = request.send() # necessary headers will be added
print response.code
body = response.get_body() # gets the body decoded from sjis and gunzipped if needed
print body