Light HTTP GET/POST wrapper for Python 2
#####Rebuild from MultipartPostHandler #####Feature: Simpler interface; supports posting Non-ASCII (dict)values and filenames. #####Author: [email protected]
Usage: webutil.request(url, data=None, has_files=False|True)
When has_files is False:
data can be a relatively complicated structure, e.g.
{ "user": { "name": "bob", "age": "18"},
"colors": ["red", "blue", "green"] }
When has_files is True:
it POST with contenttype = multipart/form-data
and data should be a simple dict, e.g.
{ "username" : "bob", "password" : "riviera",
"file" : open("filepath", "rb") }
When data is None and has_files is False:
it GET resources from the url