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
0
votes
1 answer

pycurl is working in an unexpected way

I have written a code that visits a URL using pycurl. I have tor enabled. The URL gets redirected to some other url. Below is the code. import pycurl curl = pycurl.Curl() curl.setopt(pycurl.URL, URL) curl.setopt(pycurl.PROXY,…
Satys
  • 2,319
  • 1
  • 20
  • 26
0
votes
0 answers

pyCURL segmentation fault

I'm trying to send a POST request to an HTTPS url using Python's pyCURL (curl port to python). The problem is that my script exits with segmentation fault, which happens only for the particular URL. For other URLs (either HTTP or HTTPS) it works…
Vasilis
  • 2,721
  • 7
  • 33
  • 54
0
votes
2 answers

Setting Cookie using pycurl, getting TypeError('invalid arguments to setopt',)

I am new to python I am trying to send session_id as a cookie using pycurl lib in python. Below is the code line. reportcurl.setopt(pycurl.COOKIE, session_id) Where "session_id" is a string. Not sure what I am doing wrong but it is working on…
Ali Hussain Khan
  • 111
  • 1
  • 1
  • 9
0
votes
5 answers

Python pip install failing with error code 1

I am working on CentOS6 and have been able to install python2.7. After creating a virtualenv I have started installing various packages of python. I can install some packages easily like requests,etc. but installing packages like Numpy, scipy,…
pg2455
  • 5,039
  • 14
  • 51
  • 78
0
votes
1 answer

How to send http body without the 'POST / HTTP/1.1' header using pycurl?

I send some data to mysockserver listening on a socket and expecting data as follows packet='A'+struct.pack("!I", 98)+"Hello World blah blah" It works all fine. Now I need to send above data to above socket sitting behind http mytcpipserver.com.…
0
votes
1 answer

How do I send a list of nested boolean filter queries to Elasticsearch using pycurl?

I am using ElasticSearch 1.5. I have eight nodes set up and a separate client node. I am sending a filter request to the engine via Python using pycurl. I'm trying to create some nested boolean filters. I can get two separate single boolean filters…
MrMas
  • 1,143
  • 2
  • 14
  • 28
0
votes
1 answer

python variable empty on concat after response.getvalue()

(New to python) I'm trying to make a simple authenticated put of a file... so I make two curls, the first one to authenticate (which prints the token out as expected) but when I use the same variable (token) to add it to the headers ("Authorization:…
Bradley
  • 16
  • 3
0
votes
0 answers

curl doesn't respect --connect-timeout setting

--connect-timeout option is ignored by curl command and pycurl library. Reproduction: time curl --connect-timeout 60 ftp://ftp.ossp.org/pkg/lib/uuid/uuid-1.6.2.tar.gz Can't figure out why… $ curl --version curl 7.30.0 (x86_64-apple-darwin13.0)…
mktums
  • 426
  • 1
  • 4
  • 15
0
votes
1 answer

Convert curl command to pycurl

im trying to convert the following curl call into pycurl , can someone help me out with that . curl --request 'POST' 'https://api.twitter.com/1.1/mutes/users/create.json' --data 'screen_name=fails' --header 'Authorization: OAuth…
Jecki
  • 802
  • 3
  • 16
  • 32
0
votes
1 answer

Pycurl WRITEDATA WRITEFUNCTION collision/crash

How do I turnoff WRITEFUNCTION and WRITEDATA? Using pycurl I have a class call curlUtil. In it I have pageAsString (self, URL) which returns a string. To do this I setopt WRITEFUNCTION. Now in downloadFile (self, URL, fn, overwrite=0) I do an open…
user34537
0
votes
1 answer

How to implement login handover from mechanize to pycurl

I need to login into a website by using mechanize in python and then continue traversing that website using pycurl. So what I need to know is how to transfer a logged-in state established via mechanize into pycurl. I assume it's not just about…
evolution
  • 593
  • 6
  • 20
0
votes
1 answer

Is there a line by line alternative for pycurl perform

I have the following code to read a logfile from a "box" on our network: import pycurl pycurl.Curl() pycurl_connect = pycurl.Curl() your_url = 'http://10.0.0.1:1333/cgi/WebCGI?7043' headers = ['Cookie: loginname=admin; password=e5T%7B%5CYnlcIX%7B;…
Simon Streicher
  • 2,638
  • 1
  • 26
  • 30
0
votes
1 answer

Custom pycurl call

I'm trying to implement push notifications. I can trigger notifications with this call that I need to make from python: curl -X POST -H "Content-Type: application/json" -H "X-Thunder-Secret-Key: secret2" --data-ascii "\"Hello World\""…
user568021
  • 1,426
  • 5
  • 28
  • 55
0
votes
0 answers

pycurl read and set cookie without cookie file

i am trying to save and later use cookies with pycurl. i have to store cookies to db, so that i am not using a cookie file, i am getting cookies from set cookie line in header and cookies likes main_token=d4313443f5f98d8c4deca6325d7ded9a;…
user2136174
  • 119
  • 1
  • 4
  • 12
0
votes
1 answer

How would you implement this curl command in python Requests or urllib2 or even pycurl?

How would you implement this curl command in python Requests or urllib2 or even pycurl? I've looked at tons of examples on stackoverflow and elsewhere that come close to what I'm looking for, but none shows an example that uses both…
Alkindi
  • 45
  • 8