Skip to main content

An easy to use HTTP client

Project description

Description

An easy to use HTTP client.

Installation

$ pip install urlfetch -U

Hello World

from urlfetch import get

response = get('http://python.org/')
print response.body

Upload file

from urlfetch import post

response = post(
    'http://127.0.0.1:8888/upload',
    headers = {
        'Referer': 'http://127.0.0.1/',
    },
    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.body

Project details


Download files

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

Files for urlfetch, version 0.3.1
Filename, size File type Python version Upload date Hashes
Filename, size urlfetch-0.3.1.tar.bz2 (16.5 kB) File type Source Python version None Upload date Hashes View
Filename, size urlfetch-0.3.1.tar.gz (19.3 kB) File type Source Python version None Upload date Hashes View
Filename, size urlfetch-0.3.1.zip (21.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page