Answers for "how to send curl requests through pythjon"

1

python run curl

import requests
res = requests.get('https://stackoverflow.com/questions/26000336')
Posted by: Guest on June-26-2020
0

how to make curl request python

import pycurl
import StringIO

response = StringIO.StringIO()
c = pycurl.Curl()
c.setopt(c.URL, 'https://www.googleapis.com/qpxExpress/v1/trips/search?key=mykeyhere')
c.setopt(c.WRITEFUNCTION, response.write)
c.setopt(c.HTTPHEADER, ['Content-Type: application/json','Accept-Charset: UTF-8'])
c.setopt(c.POSTFIELDS, '@request.json')
c.perform()
c.close()
print response.getvalue()
response.close()
Posted by: Guest on October-12-2020

Python Answers by Framework

Browse Popular Code Answers by Language