Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

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 over HTTPS and return contents as a string:

import SimpleHttpFetch

contents = SimpleHttpFetch.fetchUrl(‘’)

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 over HTTP, and convert to a python dictionary:

import SimpleHttpFetch

jsonContents = SimpleHttpFetch.fetchUrlAsJson(‘’)

So simple!

Fetch the linux kernel, do not try to decode into text.:

import SimpleHttpFetch

kernel = SimpleHttpFetch.fetchUrlRaw(‘’)


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: .

Release History

Release History

This version
History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
SimpleHttpFetch-4.0.0.tar.gz (26.9 kB) Copy SHA256 Checksum SHA256 Source Mar 31, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting