mirror of
https://github.com/ProxymanApp/Proxyman.git
synced 2026-04-27 00:55:57 +03:00
[GH-ISSUE #898] When uploading form data, "copy curl" does not get the body #895
Labels
No labels
Discussion
Feature request
In Progress...
Plugins
Waiting response
Windows
Windows
bug
duplicate
enhancement
feature
good first issue
iOS
macOS 10.11
question
wontfix
✅ Done
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/Proxyman#895
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @PangYenChen on GitHub (May 24, 2021).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/898
Originally assigned to: @NghiaTranUIT on GitHub.
Proxyman version? (Ex. Proxyman 1.4.3)
2.25.0 (22500)
macOS Version? (Ex. mac 10.14)
10.15.6(19G2021)
Steps to reproduce
Upload an image using form data format,
and Proxyman gui click "copy curl".
Expected behavior
Get the curl with form data format body.
@NghiaTranUIT commented on GitHub (May 24, 2021):
Thanks for the bug report @PangYenChen. I'm able to reproduce the bug when uploading the file with multipart/form-data 👍
I'm going to fix it and send a BETA build this week 🌮
@NghiaTranUIT commented on GitHub (May 24, 2021):
Hey @PangYenChen, there are two possible solutions:
cURL with the invalid body, but exact multipart/form-data
I tried to perform the "copy as a cURL" with Charles and Fiddler, and the result is:
It's exactly the request body, but when executing it on the Terminal, it yields the error (Invalid body).
Better cURL with -F option
From cURL Doc, we can use
-Fto make a correct multipart/form-data request.You can execute this cURL on the Terminal app. However, it appends the
boundary=------------------------4b3032089740ba4fautomatically.Just wondering, what scenario do you need? @PangYenChen 🤔
@PangYenChen commented on GitHub (May 24, 2021):
I want to upload an image to the server from a mobile app.
I need to tell my backend colleague what request the mobile app sent.
In general, the image file is not a local file on my computer.
So, the exact multipart/form-data will be better.
I am not a native English speaker. Please pardon me.
@NghiaTranUIT commented on GitHub (May 24, 2021):
Thanks for your clarification @PangYenChen 👍 I will follow this approach because it's easier to implement 😄
@NghiaTranUIT commented on GitHub (May 24, 2021):
@PangYenChen please check out this Beta build: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_2.26.0_cURL_Multipart_Form_Data.dmg
It will fix your bug 👍
@NghiaTranUIT commented on GitHub (May 25, 2021):
Meanwhile, I've implemented the multipart/form-data previewer at https://github.com/ProxymanApp/Proxyman/issues/833#issuecomment-847667322
Please check it out 😄 @PangYenChen
@PangYenChen commented on GitHub (May 25, 2021):
Thanks a lot!
Though it works properly for my case, I think that generally “Better cURL with -F option” would be a better option for other people.
If there is a switch to toggle the result of “copy curl”, it would be perfect!
It’s just a suggestion.
Thanks again!
By the way, multipart/form-data previewer is amazing!