0

I have a python script which does a bunch of PUTs and POSTs, and when they are successful curl will output the updated html to stdout. I was wondering if there was a way to keep it from doing this? I don't really care about this information, so sending it to a file isn't necessary, but that seems to be the only solution I can find.

Ishka
  • 1
  • 1
  • By 'curl', do you mean the pycurl Python module, or the 'curl' executable? In any case, can you show a snippet of code? – automaciej Jan 22 '11 at 16:05

1 Answers1

0

Try setting the WRITEFUNCTION option in the Curl object.

from StringIO import StringIO
body = StringIO()
(...)
c.setopt(c.WRITEFUNCTION, body.write)

Full example can be seen in curl CVS repository.

automaciej
  • 429
  • 3
  • 14