ProxymanApp / Proxyman

Modern. Native. Delightful Web Debugging Proxy for macOS, iOS, and Android ⚡️
https://proxyman.io
5.73k stars 189 forks source link

[BUG] Incorrect cURL from multipart/form Request #1018

Open NghiaTranUIT opened 3 years ago

NghiaTranUIT commented 3 years ago

Description

If we do "copy as cURL" from a multipart/form request, the output is incorrect.

For instance,

curl -v 'http://httpbin.org/anything' \
-X POST \
-H 'Content-Type: multipart/form-data; charset=utf-8; boundary=__X_PAW_BOUNDARY__' \
-H 'Authorization: ' \
-H 'Host: httpbin.org' \
-H 'Content-Length: 162' \
-H 'w: ' \
-H 'wqwefwfe: ' \
-H 'Connection: close' \
-H 'User-Agent: Paw/3.3.0 (Macintosh; OS X/11.5.2) GCDHTTPRequest' \
-d '--__X_PAW_BOUNDARY__
Content-Disposition: form-data; name="1"

2
--__X_PAW_BOUNDARY__
Content-Disposition: form-data; name="3"

4
--__X_PAW_BOUNDARY__--

We could not post a multipart/form with -d param. We have to use -F

NghiaTranUIT commented 3 years ago

Done https://github.com/ProxymanApp/Proxyman/issues/1020#issuecomment-939763736 👍