Linked Questions
37 questions linked to/from Send file using POST from a Python script
1
vote
1
answer
13k
views
How send post file (image) in python 3 [duplicate]
first excuse me for my bad english (i speak spanish).
I am trying submit a form uploading with an image.
When i want send normal data (how text string) i do this:
First import modules:
import ...
0
votes
1
answer
2k
views
How to do a curl POST command in flask python app [duplicate]
i work on a little flask app, which consists in searching docs with keywords (ElasticSSearch) and upload docs in cluster.
Searching docs works fine but upload is hard, i can do it with curl but i ...
0
votes
0
answers
172
views
POST a PIL image without saving to disk [duplicate]
I have 3 servers, at A server, I choose a image in the browser and POST it to the B server using urllib2, at B server,I get the image POST from A and make some changes to it, then POST to C server, C ...
215
votes
24
answers
484k
views
Generate a random letter in Python
Is there a way to generate random letters in Python (like random.randint but for letters)? The range functionality of random.randint would be nice but having a generator that just outputs a random ...
279
votes
9
answers
664k
views
How to upload file with python requests?
I'm performing a simple task of uploading a file using Python requests library. I searched Stack Overflow and no one seemed to have the same problem, namely, that the file is not received by the ...
76
votes
4
answers
214k
views
Python POST binary data
I am writing some code to interface with redmine and I need to upload some files as part of the process, but I am not sure how to do a POST request from python containing a binary file.
I am trying ...
16
votes
2
answers
9k
views
What are valid characters for creating a multipart form boundary?
In an HTML form post what are valid characters for creating a multipart boundary?
6
votes
3
answers
22k
views
Python requests post a file
Using CURL I can post a file like
CURL -X POST -d "pxeconfig=`cat boot.txt`" https://ip:8443/tftp/syslinux
My file looks like
$ cat boot.txt
line 1
line 2
line 3
I am trying to achieve the same ...
5
votes
5
answers
14k
views
HTTP POST binary files using Python: concise non-pycurl examples?
I'm interested in writing a short python script which uploads a short binary file (.wav/.raw audio) via a POST request to a remote server.
I've done this with pycurl, which makes it very simple and ...
7
votes
3
answers
16k
views
Send file using POST from a Python script
This is an almost-duplicate of Send file using POST from a Python script, but I'd like to add a caveat: I need something that properly handles the encoding of fields and attached files. The solutions ...
9
votes
2
answers
9k
views
Properly format multipart/form-data body
Introduction
Background
I'm writing a script to upload stuff including files using the multipart/form-data content type defined in RFC 2388. In the long run, I'm trying to provide a simple Python ...
2
votes
1
answer
8k
views
Using Python-Requests Library to Post a Text File
Hi I'm having trouble posting a text file using the Python Requests Library ( http://docs.python-requests.org/en/latest/index.html ), can you let me know what I'm doing wrong?
I tried searching for ...
3
votes
1
answer
12k
views
Upload file via POST multipart form-data using Python
I have the following code in C# that I need to convert into Python.
Code in C#:
{
var fileName = new FileInfo(file);
string requestString = "url to be used&...
2
votes
1
answer
7k
views
'requests.post' Files Upload Large File: (More than ~1.5 MB): Python
Here I'm trying to use requests.post for file upload.
Wrote procedure.
import requests
def upload_file_to_gcs():
url = 'http://127.0.0.1:8500/save-data-to-gcs/'
f = {'file': ('Product_Master....
3
votes
2
answers
4k
views
Problems URL encoding a binary file in python
So the process I'm performing seems to make logical sense to me but I keep getting an error. So I have this binary file I'm trying to send to a server (Shapeways to be exact. It's a binary 3d model ...