fd1395a26d6b57349d25acef86fc81d099befe82
[plcapi.git] / pycurl / tests / test_post2.py
1 #! /usr/bin/env python
2 # -*- coding: iso-8859-1 -*-
3 # vi:ts=4:et
4 # $Id: test_post2.py,v 1.13 2005/03/03 10:00:40 kjetilja Exp $
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()