rwf2 / multer

An async parser for multipart/form-data content-type in Rust
MIT License
158 stars 37 forks source link

Does this crate work with multipart/mixed ? #24

Closed Armiixteryx closed 3 years ago

Armiixteryx commented 3 years ago

Hello.

I would like to know if this crate can work with multipart/mixed data. I am consuming a REST API whose response is in the following format:

--simple_boundary 
Content-type: application/json

[JSON HERE]
--simple_boundary 
Content-Disposition: form-data
Content-type: application/octet-stream
Content-Transfer-Encoding: base64
Content-ID:[ID]

[LONG B64 HERE]
--simple_boundary--

This is the content-type header:

"content-type": "multipart/mixed; boundary=\"simple_boundary\""

I am using reqwest 0.10.10 to send the request to API and to get the response in a stream of bytes as required to multer, but when calling next_field fn I get the following error:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: multer: Multipart stream is incomplete'

Then I am not sure if because the content-type says the response is multipart/mixed multer won't work with this response.

Thank you for your help on this. All the best!

Armiixteryx commented 3 years ago

Closing this since real issue is inside #25 .