0
2461
The following curl command can be converted to python code as follows:
curl -d @request.json --header "Content-Type: application/json" https://www.googleapis.com/qpxExpress/v1/trips/search?key=somekey
Python Code:
import requests
url = 'https://www.googleapis.com/qpxExpress/v1/trips/search?key=somekey'
payload = open("request.json")
headers = {'content-type': 'application/json', 'Accept-Charset': 'UTF-8'}
r = requests.post(url, data=payload, headers=headers)
Comment here