Taking a pandas dataframe of the form:
fname lname age
mark trumb 34
samb jones 26
I'd like to construct a url query using the requests module. Normally, I would construct the url like so:
payload = {'key1':'value1','key2':'value2'}
headers = {'content-type': 'application'}
base_url = 'https://website.com/'
req = requests.post(base_url,headers=headers,params=payload)
How would I best use this so that the dataframe columns become the keys, and the rows become the values?
The new output column (req) would look like this:
fname lname age req
mark trumb 34 https://website.com?fname=mark&lname=trumb&age=34
samb jones 26 https://website.com?fname=samb&lname=jones&age=26