Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python request post with json with headers

url = "http://localhost:8080"
data = {'sender': 'Alice', 'receiver': 'Bob', 'message': 'We did it!'}
headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
r = requests.post(url, data=json.dumps(data), headers=headers)
Comment

PREVIOUS NEXT
Code Example
Python :: how to change colour of rows in csv using pandas 
Python :: print 1 thing repeatedly in 1 line python 
Python :: presentation in jupyter notebook 
Python :: python datetime from isoformat 
Python :: python numpy reverse an array 
Python :: Python Relative Strength Indicator 
Python :: check if a value in dataframe is nan 
Python :: python custom array sort 
Python :: how to get current time in milliseconds in python 
Python :: python edit text file 
Python :: numpy.datetime64 to datetime 
Python :: print without changing line python 
Python :: the four pillars of Op in Python 
Python :: pythonic 
Python :: django email settings 
Python :: min max scaling pandas 
Python :: # find the common elements in the list. 
Python :: how to get chat first name in telebot 
Python :: find common words in two lists python 
Python :: how to get current page url in django template 
Python :: python random phone number 
Python :: intersection of dataframes based on column 
Python :: Goal Parser Python 
Python :: python head function show all columns 
Python :: python transpose list 
Python :: how to create list from a to z in python 
Python :: how to change web browser in python 
Python :: longest substring without repeating characters python 
Python :: pil image shape 
Python :: add jupyter environment 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =