skip to navigation
skip to content

Not Logged In

urlfetch 0.3.7

An easy to use HTTP client

Package Documentation

Latest Version: 1.0

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

Contributors

 
File Type Py Version Uploaded on Size
urlfetch-0.3.7.tar.bz2 (md5) Source 2012-06-28 18KB
urlfetch-0.3.7.tar.gz (md5) Source 2012-06-28 20KB
urlfetch-0.3.7.zip (md5) Source 2012-06-28 23KB
  • Downloads (All Versions):
  • 113 downloads in the last day
  • 1194 downloads in the last week
  • 6445 downloads in the last month