Handling multipart/form-data requests
See original GitHub issueFirst of all thanks a lot for your excellent work on the HTTP server!
I’m wondering whether you support multipart/form-data
requests. I’m trying to upload a file using curl:
curl -v http://192.168.1.100/test -F "image=@test.txt"
but I’m getting an empty bytearray from a call to ReadRequestContent()
. Am I doing something wrong or it’s not supported yet?
Here’s the output from curl:
* Trying 192.168.1.100...
* TCP_NODELAY set
* Connected to 192.168.1.100 (192.168.1.100) port 80 (#0)
> POST /test HTTP/1.1
> Host: 192.168.1.100
> User-Agent: curl/7.54.0
> Accept: */*
> Content-Length: 90842
> Expect: 100-continue
> Content-Type: multipart/form-data; boundary=------------------------fa4b1f9e0d76e70b
>
* HTTP 1.0, assume close after body
< HTTP/1.0 500 Internal Server Error
< Content-Type: text/html; charset=UTF-8
< Content-Length: 250
< Server: MicroWebSrv by JC`zic
< Connection: close
<
<html>
<head>
<title>Error</title>
</head>
<body>
<h1>500 Internal Server Error</h1>
Server got itself in trouble
</body>
</html>
* Closing connection 0
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to send a "multipart/form-data" with requests in python?
If you specify both files and data , then it depends on the value of data what will be used to create the...
Read more >Handling multipart/form-data natively in Python - Julien Danjou
The multipart/form-data format is quite simple to understand and can be summarised as an easy way to encode a list of keys and...
Read more >TIL: Howto create multipart form data in Python - Tim Head
Today I learnt how to encode data as multipart/form-data in Python. This is useful if you want to construct the body of a...
Read more >Sending Request for Ticket creation using MultiPart Form ...
A multipart form-post is an HTTP request sent using an HTML form, submitted with enctype set to "multipart/form-data". The request body is ...
Read more >Python Requests - multipart form data : r/learnpython
I am new to python requests and python in general - I have a somewhat intermediate java background. I am trying to figure...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello,
I released a fully new version (v2.0) of my web server here : github.com/jczic/MicroWebSrv2. Open source MIT, fully asynchronous, more robust, more fast and more efficient! It is delivered with a good documentation.
Thank you for your support and feedback. ☺️
Jean-Christophe Bos
Le mar. 24 juil. 2018 à 01:08, Josh Lloyd notifications@github.com a écrit :
–
Sincèrement,
I’ve roughly implemented this myself.
It doesn’t follow your style, is hastily written and has no tests. But I needed it working for an End of Sprint demo. I can make a PR possibly later this week. I’ve also added gzip “support” if the files are gzipped on flash.