X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=pycurl%2Ftests%2Ftest_post.py;fp=pycurl%2Ftests%2Ftest_post.py;h=574bbda780d38a44fb263ba6065a22a30944896b;hb=713604a9906484482d3d579cf3291795f39a494e;hp=0000000000000000000000000000000000000000;hpb=786889514c70b24c28a958dc84c799b45bf1a255;p=plcapi.git diff --git a/pycurl/tests/test_post.py b/pycurl/tests/test_post.py new file mode 100644 index 0000000..574bbda --- /dev/null +++ b/pycurl/tests/test_post.py @@ -0,0 +1,24 @@ +#! /usr/bin/env python +# -*- coding: iso-8859-1 -*- +# vi:ts=4:et +# $Id: test_post.py,v 1.9 2003/04/21 18:46:11 mfx Exp $ + +import urllib +import pycurl + +# simple +pf = {'field1': 'value1'} + +# multiple fields +pf = {'field1':'value1', 'field2':'value2 with blanks', 'field3':'value3'} + +# multiple fields with & in field +pf = {'field1':'value1', 'field2':'value2 with blanks and & chars', + 'field3':'value3'} + +c = pycurl.Curl() +c.setopt(c.URL, 'http://pycurl.sourceforge.net/tests/testpostvars.php') +c.setopt(c.POSTFIELDS, urllib.urlencode(pf)) +c.setopt(c.VERBOSE, 1) +c.perform() +c.close()