Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

flask sending post request

#make a POST request
import requests
dictToSend = {'question':'what is the answer?'}
res = requests.post('http://localhost:5000/tests/endpoint', json=dictToSend)
print 'response from server:',res.text
dictFromServer = res.json()
Comment

PREVIOUS NEXT
Code Example
Python :: matplotlib larger chart 
Python :: how to filter queryset with foreign key in django 
Python :: how to install package offline 
Python :: how to remove some characters from a string in python 
Python :: python opérateur ternaire 
Python :: how to print data type in python 
Python :: django model get field verbose name 
Python :: change the number in 3rd line to get factorial for the number you want. Ex: num = 30 
Python :: calculate perimeter of rectangle in a class in python 
Python :: example of ternary operator in python 
Python :: python remove spaces from string 
Python :: python for loop with index 
Python :: pyton count number of character in a word 
Python :: installing required libraries in conda environment 
Python :: how to get the realpath with python 
Python :: duplicates in python list 
Python :: python gzip a file 
Python :: how to set numerecal index in pandas 
Python :: python sum lists element wise 
Python :: time in python code 
Python :: cronometer python 
Python :: df sort by column names 
Python :: datetime from float python 
Python :: how to find index of maximum value in dataframe in python 
Python :: append multiple values to 2d list python 
Python :: flask recive list 
Python :: permutation python 
Python :: how to get SITE_ID in django....shell 
Python :: python code to demonstrate inheritance 
Python :: drop 0 in np array 
ADD CONTENT
Topic
Content
Source link
Name
5+9 =