git://git.onelab.eu
/
plcapi.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
set svn:keywords property for proper keywords expansion
[plcapi.git]
/
pycurl
/
tests
/
test_stringio.py
1
#! /usr/bin/env python
2
# -*- coding: iso-8859-1 -*-
3
# vi:ts=4:et
4
# $Id$
5
6
import sys
7
try:
8
from cStringIO import StringIO
9
except ImportError:
10
from StringIO import StringIO
11
import pycurl
12
13
url = "http://curl.haxx.se/dev/"
14
15
print "Testing", pycurl.version
16
17
body = StringIO()
18
c = pycurl.Curl()
19
c.setopt(c.URL, url)
20
c.setopt(c.WRITEFUNCTION, body.write)
21
c.perform()
22
c.close()
23
24
contents = body.getvalue()
25
print contents