Merge remote-tracking branch 'origin/pycurl' into planetlab-4_0-branch
[plcapi.git] / trunk / pycurl / tests / test_post2.py
1 #! /usr/bin/env python
2 # -*- coding: iso-8859-1 -*-
3 # vi:ts=4:et
4 # $Id$
5
6 import pycurl
7
8 pf = [('field1', 'this is a test using httppost & stuff'),
9       ('field2', (pycurl.FORM_FILE, 'test_post.py', pycurl.FORM_FILE, 'test_post2.py')),
10       ('field3', (pycurl.FORM_CONTENTS, 'this is wei\000rd, but null-bytes are okay'))
11      ]
12
13 c = pycurl.Curl()
14 c.setopt(c.URL, 'http://www.contactor.se/~dast/postit.cgi')
15 c.setopt(c.HTTPPOST, pf)
16 c.setopt(c.VERBOSE, 1)
17 c.perform()
18 c.close()