Questions tagged [pycurl]

PycURL is a Python interface to libcurl.

PycURL is a Python interface to libcurl. PycURL can be used to fetch objects identified by a URL from a Python program, similar to the urllib Python module. PycURL is mature, very fast, and supports a lot of features.

609 questions
4
votes
2 answers

Converting PHP curl_setopt() to Python Requests and to CLI curl

I am trying to convert the following PHP curl_setopt() to the equivalent within Python Requests as well as for CLI curl. For Python, if not possible in Requests, I will resort using pycurl. curl_setopt($process, CURLOPT_RETURNTRANSFER,…
jeff00seattle
  • 1,291
  • 5
  • 17
  • 31
4
votes
2 answers

How make HEAD request to pycurl

I need to send a HTTP HEAD request using pycurl. This code curl = pycurl.Curl() ... curl.setopt(curl.CUSTOMREQUEST, "HEAD") curl.perform() produces an error: < HTTP/1.1 200 OK * Server nginx/1.6.2 is not blacklisted < Server: nginx/1.6.2 < Date: #…
StasEvseev
  • 95
  • 8
4
votes
0 answers

Failed to re-build pycurl with OpenSSL

I'm trying to rebuild pycurl with OpenSSL because of this bug. I use this example: sudo apt-get install build-essential fakeroot dpkg-dev mkdir ~/python-pycurl-openssl cd ~/python-pycurl-openssl sudo apt-get source python-pycurl sudo apt-get…
Valeria
  • 95
  • 6
4
votes
2 answers

How would you use a cURL "GET" with a Python based REST API for network programming?

Let me begin by saying I am a novice with cURL, Python and REST. Here's what I'm trying to do: I have a virtual network with an SDN controller (Contrail). Contrail has a Python based REST API to allow for network automation development and…
leafsca
  • 65
  • 1
  • 5
4
votes
2 answers

PycURL Attachments and Progress Functions

Working on a small project utilising an API that you send a request to and then it gives you back a response with a zip file attached which you then download. My first pass at automating this download tried to utilise the setopt(curl.WRITEDATA, fp)…
Jonathan Rainer
  • 144
  • 1
  • 14
4
votes
5 answers

Automate interaction with a webpage in python

I want to automate interaction with a webpage. I've been using pycurl up til now but eventually the webpage will use javascript so I'm looking for alternatives . A typical interaction is "open the page, search for some text, click on a link (which…
nafe
  • 379
  • 5
  • 16
4
votes
1 answer

What is PyCurl's default timeout

Well, I think the title of the question is very self explanatory, so you probably don't need to keep reading, but here it goes: I have been working with PyCurl for a while, and I've always set my timeouts using curlConnector =…
Savir
  • 17,568
  • 15
  • 82
  • 136
4
votes
5 answers

Linux Yum Fatal Python error: pycurl: libcurl link-time version is older than compile-time version

So this error is driving me crazy, I've search the web multiple times, ran a few things and no results. I get the following error when using yum. [root@texas pycurl-7.19.0]# yum update Fatal Python error: pycurl: libcurl link-time version is older…
Vernard
  • 345
  • 4
  • 10
  • 18
4
votes
1 answer

Python(2.6) cStringIO unicode support?

I'm using python pycurl module to download content from various web pages. Since I also wanted to support potential unicode text I've been avoiding the cStringIO.StringIO function which according to python docs: cStringIO - Faster version of…
Ivan Kovacevic
  • 1,322
  • 12
  • 30
4
votes
4 answers

Install pyCurl in ActivePython-2.6?

I have worked with pyCurl in the past and have it working with my system default python install. However, I have a project that requires python to be more portable and I am using ActivePython-2.6. I have had no problems installing any other modules…
joshcody
  • 105
  • 3
  • 6
3
votes
2 answers

python 2.7 re.MULTILINE troubles

I am new to python and I have been trying to change my php regex into python but I have run into some problems with this multiline thing. I have been up and down the internet for the past couple days and I can't seem to make sense of it, if someone…
classyhobo
  • 245
  • 1
  • 2
  • 5
3
votes
1 answer

POSTing a file and passing a parameter using pycurl

I have figured out how to do GET, PUTs, DELETEs and basic POST using pycurl. Nevertheless, I can't figure out what is the equivalent of this curl command line (which works perfectly fine) to python: curl -u admin:geoserver -XPOST -H 'Content-type:…
rburhum
  • 1,611
  • 2
  • 17
  • 33
3
votes
2 answers

cURL (pycurl) FTP over HTTP proxy

I writing simple uploading script and just catched next thing: curl tries to do PUT on a ftp server: The simplified code: import pycurl from os.path import getsize c = pycurl.Curl() c.setopt(pycurl.URL,…
mik_os
  • 670
  • 1
  • 6
  • 10
3
votes
2 answers

How to abstract from pycurl the correct way

I would like to write a pseudo module that makes one do a GET request that keeps on going (pretty much like the one to consume the Twitter Streamming API), but making unnecessary to give in all the parameters everytime someone wants to call a…
João Pinto Jerónimo
  • 9,586
  • 15
  • 62
  • 86
3
votes
1 answer

How to install a package with Poetry that requires CLI args?

Here's an example that requires it: poetry add pycurl ... gives: ImportError: pycurl: libcurl link-time ssl backend (openssl) is different from compile-time ssl backend (none/other) The fix is given in that post: pip install --compile…
P i
  • 29,020
  • 36
  • 159
  • 267