Python module that will, in a single line, fetch an http/https url and return a string or dictionary (JSON)
Project description
SimpleHttpFetch supports through the most simple interface possible fetching of URLs as strings or JSON as dict
It supports both HTTP and HTTPS through the same interface. It will automatically follow 301 redirects and Location headers, you do not have to worry about handling that.
Fetching the contents of a URL could not be simpler!!!
Example Usage
Fetch google.com over HTTPS and return contents as a string:
import SimpleHttpFetch
contents = SimpleHttpFetch.fetchUrl(’https://www.google.com’)
That’s it!!!
You can also convert a page that returns JSON into a dictonary with a single call as well!
Fetch a servlet that returns JSON from example.com over HTTP, and convert to a python dictionary:
import SimpleHttpFetch
jsonContents = SimpleHttpFetch.fetchUrlAsJson(’http://www.example.com/myJsonServlet?username=myuser’)
So simple!
Full Documentation
Full documentation on other methods and arguments can be found here: http://htmlpreview.github.io/?https://github.com/kata198/SimpleHttpFetch/blob/master/doc/SimpleHttpFetch.html .
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file SimpleHttpFetch-1.1.2.tar.gz
.
File metadata
- Download URL: SimpleHttpFetch-1.1.2.tar.gz
- Upload date:
- Size: 13.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 104bcf7283fe3bc67876ceafd2e37d9c6e53dc303d0ba8b56afbefd52ae59bf4 |
|
MD5 | e86c678d8711427cd64805fdd6e655b1 |
|
BLAKE2b-256 | 9cd6e777157d76b41e488ddb8d44540c56441d9f06c9ef78a50aea1954d7cd2a |