Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to send file in python request

files = {'upload_file': open('file.txt','rb')}
values = {'DB': 'photcat', 'OUT': 'csv', 'SHORT': 'short'}

r = requests.post(url, files=files, data=values)
Comment

PREVIOUS NEXT
Code Example
Python :: python merge list of lists 
Python :: python get substring between strings 
Python :: python is dict 
Python :: python fractions 
Python :: selenium set chrome executable path 
Python :: python sets 
Python :: prevent division by zero numpy 
Python :: bar plot bokeh 
Python :: flask error handling 
Python :: isalnum python 
Python :: for in python 
Python :: python create array 
Python :: how to print a variable in python 
Python :: counter in python 
Python :: sample logistic regression parameters for gridsearchcv 
Python :: python test if list of dicts has key 
Python :: How to check if a given string is a palindrome, in Python? 
Python :: Flatten List in Python Using NumPy Flatten 
Python :: python readlines end of file 
Python :: how to make chrome extension in python 
Python :: check if two columns are equal pandas 
Python :: how to exit program in python 
Python :: deleting in a text file in python 
Python :: delete column in dataframe pandas 
Python :: Print First 10 natural numbers using while loop 
Python :: sendgrid send email to multiple recipients python 
Python :: list methods append in python 
Python :: train-test split code in pandas 
Python :: python get local ipv4 
Python :: is tuple immutable in python 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =