Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

dictionaries to http data python

dictionary = {"a":2,"b":3,"kirekhar":"kireasb"}

#WAY NUMBER ONE:
result = ""
for key,val in zip(dic.keys(),dic.values()):
	result+=key+"="+str(val)+";"
print(result) # OUTPUT : 'a=2;b=3;kirekhar=kireasb;'
requests.post(url, data=result)

#WAY NUMBER TWO:
import json
requests.post(url, data=json.dumps(dictionary))

#WAY NUMBER THREE:
requests.post(url, json=dictionary)
Comment

PREVIOUS NEXT
Code Example
Python :: chrome driver download for selenium python 
Python :: how to apply logarithm in pandas dataframe 
Python :: easiest way to position labels in tkinter 
Python :: python get dir 
Python :: how to multiply inputs in python 
Python :: selenium page down key python 
Python :: python object to json file 
Python :: series has no attirubte reshape python 
Python :: how to return the derivative of a function in python 
Python :: find location of library python linux 
Python :: print specific part in bold or colours and end. 
Python :: python get webpage source 
Python :: string module in python 
Python :: module pygame has no member 
Python :: matplotlib background color 
Python :: python split string capital letters 
Python :: python generate secret key 
Python :: np not defined 
Python :: redirect to the same page django 
Python :: ionic python2 Error: not found: python2 
Python :: built in function in python 
Python :: update link python is python 3 
Python :: python detect internet connection 
Python :: jupyter notebook how to set max display row columns matrix numpy 
Python :: remove minimize and maximize and cancle button python pyqt5 
Python :: python parse args 
Python :: django and react url conflict 
Python :: program to calculate the volume of sphere python 
Python :: from csv to pandas dataframe 
Python :: delete files inside folder python 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =