SimpleHttpFetch
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!
Fetch the linux kernel, do not try to decode into text.:
import SimpleHttpFetch
kernel = SimpleHttpFetch.fetchUrlRaw(’https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.4.1.tar.xz’)
Encodings
SimpleHttpFetch will check for the “charset” defined in Content-type header, and use that as the encoding. If that is not found, it will use the “defaultEncoding” param, which defaults to utf-8.
Binary Data
To fetch binary data, use the “fetchUrlRaw” method, or pass “nodecode” as the “defaultEncoding” paramater. Use this mode to fetch images, video, tarballs, etc.
Extra Headers
The automatic headers needed for an HTTP/HTTPS request are provided by default, but you may override or provide your own headers through the “headers” parameter to most functions.
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?vers=2 .
Metadata
Release files for SimpleHttpFetch 4.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| SimpleHttpFetch-4.0.0.tar.gz | 26.9 kB | Without provenance | Details for SimpleHttpFetch-4.0.0.tar.gz |
Release files / SimpleHttpFetch-4.0.0.tar.gz
| Download URL | SimpleHttpFetch-4.0.0.tar.gz |
|---|---|
| Size | 26.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6710bf384f213af4e66bcd88444cdfac2196e989ac0531fc4025bd9bb8454392
|
|
BLAKE2b-256 checksum How to use checksums |
1ab3eec7389266c94b5f80e2d94513933a3595b75562d478285f731486d08ca0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for SimpleHttpFetch 4.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.