python-hyper / hyper

HTTP/2 for Python.
http://hyper.rtfd.org/en/latest/
MIT License
1.05k stars 191 forks source link

how to use hyper send a multiple part http request #362

Closed xiaoxiaojuan closed 6 years ago

xiaoxiaojuan commented 6 years ago

for example my body is like below

I want to send one by one, for I want to send the json part and then the audio part and then the end boundary., and then get the response .

Not sure how to do it

------------------------------4ebf00fbcf09 Content-Disposition: form-data; name="metadata" Content-Type: application/json; charset=UTF-8

{data}

------------------------------4ebf00fbcf09 Content-Disposition: form-data; name="audio" Content-Type: application/octet-stream audio data ------------------------------4ebf00fbcf09--

Lukasa commented 6 years ago

You would need to construct the body yourself, probably by using a library, and then call request with the appropriate body.