How to use curl upload one image file using “Content-Type: multipart/related”

前端 未结 2 2023
伪装坚强ぢ
伪装坚强ぢ 2020-12-21 08:44

curl --trace trace.txt -X POST -H \'Content-Type: multipart/related; boundary=boundary_1234\' --data-binary $\'--boundary_1234\\r\\nContent-Type: application/json; charset=U

2条回答
  •  臣服心动
    2020-12-21 09:32

    Update: It was pointed out that I didn't read the question properly for my previous answer. curl -F is for multipart/form-data not for multipart/related.

    In fact, curl has no convenient way to send a multipart/related stream that I can think of. Are you really sure that is what you want to send?

    When you used your command line, you got the entire transfer logged in 'trace.txt'. Didn't that aid you in finding out what's wrong?

提交回复
热议问题