Answers for "convert from python to curl"

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
0

convert from python to curl

import sys

test_str = str(sys.argv)
# printing original string 
res = ''.join(format(ord(i), '08b') for i in test_str)
# printing result 
#print(str(res))#binary
print(str(test_str))#base64
Posted by: Guest on November-22-2021
0

convert from python to curl

import sys

test_str = str(sys.argv)
# printing original string 
res = ''.join(format(ord(i), '08b') for i in test_str)
# printing result 
#print(str(res))#binary
print(str(test_str))#base64
Posted by: Guest on November-22-2021

Python Answers by Framework

Browse Popular Code Answers by Language