Sending multipart/mixed content with Postman Chrome extension

后端 未结 2 634
我寻月下人不归
我寻月下人不归 2020-12-12 23:51

I\'m struggling with creating POST multipart/mixed request with Postman Chrome extension

Here is my curl request what works nice

curl -H \"Content-Ty         


        
2条回答
  •  执念已碎
    2020-12-13 00:31

    Left this comment on: https://github.com/postmanlabs/postman-app-support/issues/1104

    Ninja update: Not sure if this will help anyone else but there is a workaround for a specific scenario where you have multiple file types / content types being uploaded in a single multipart POST request.

    1. Set the Header Content-Type to multipart/mixed.
    2. Select the form-data option in Body.
    3. Convert all of your items into files. String content should become a text file, etc.
    4. Add each file by selecting file, adding a key name.

    This approach doesn't require actually manually specifying each Content-Type or Content-Disposition. The trick here was to serialize all relevant content into a persistent file type. You can ignore the "convert it into a file" step if it's text :) Hope that helps someone!

提交回复
热议问题