Skip to main content

An easy to use HTTP client

Project description

urlfetch is a simple, lightweight and easy to use HTTP client for Python. It is distributed as a single file module and has no depencencies other than the Python Standard Library.


  • Distributed as a single file module, has no depencencies other than the Python Standard Library.

  • Pure Python, works fine with gevent.

  • Small codebase, about 1000 lines and 30% are comments and blank lines. Only 10 minutes you can know every detail.

  • Random user-agent.

  • Support streaming.


$ pip install urlfetch

Hello, world

import urlfetch

response = urlfetch.get('')
print response.status, response.reason
print len(response.content)

Uploading files

import urlfetch

response =
    headers = {
        'Referer': '',
    files = {
        'fieldname1': open('/path/to/file', 'rb'),
        #'fieldname2': 'file content', # file must have a filename
        'fieldname3': ('filename', open('/path/to/file2', 'rb')),
        'fieldname4': ('filename', 'file content'),
    data = {
        'foo': 'bar'

print response.status, response.content


To run the tests, urlfetch relies on bottle and gunicorn. If the tests are run by calling python test, the dependencies will be handled automatically (via tests_require). So, if you want to run the tests directly, that is, python tests/, make sure bottle and gunicorn are installed under the PYTHONPATH.

Download files

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

Source Distribution

urlfetch-1.2.2.tar.gz (68.6 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page