import requests
import pandas

url = 'https://httpbin.org/post'
request_headers = {
    'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',
}
form_data = {
    'custname':'abc',
    'custtel':'123',
    'custemail':'[email protected]',
    'size':'small',
    'topping':'bacon',
    'topping':'onion',
    'topping':'cheese',
    'topping':'mushroom',
    'delivery':'20:00',
    'comments':'none',
}
r = requests.post(url, data=form_data, headers=request_headers)
print(r.text)
dic = r.json()['form']
print(dic)
df = pandas.DataFrame([dic])
df

results matching ""

    No results matching ""