mirror of
https://github.com/ProxymanApp/Proxyman.git
synced 2026-04-28 09:35:55 +03:00
[GH-ISSUE #615] request.body in scripting is incorrect #612
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#612
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 @trycatchx on GitHub (Sep 4, 2020).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/615
Proxyman version? (Ex. Proxyman 1.4.3)
2.5.3
1、The http.body of my request on the homepage is like this.

{"req_0":{"method":"GetNewCommentList","module":"music.globalComment.CommentReadServer","param":{"BizType":31,"BizId":"012wNuzn25fa0b","LastCommentId":"","LastCommentSeqNo":"","PageSize":15,"PageNum":0,"FromCommentId":"","WithHot":1}},"comm":{"g_tk":5381,"uin":0,"format":"json","platform":"h5","ct":23,"cv":0}}2、The same http.body is displayed differently in scripting:

I am use this code to print it:
The requset.body in scripting is wrong ? which makes me unable to modify requset.body.
@NghiaTranUIT Can you help me solve it?
@NghiaTranUIT commented on GitHub (Sep 4, 2020):
@zhangchaojiong Since the ContentType of the Request is
form-urlencoded, so Proxyman attempts to parse the body as a Form. Thus, you get the weird body.There are three ways to fix it:
If you're a developer of this app, please try to change the Content Type of the Request from your app. It should be
application/json. Then,request.bodyis a JSON ObjectOr You can fix in the script by using
@trycatchx commented on GitHub (Sep 4, 2020):
@NghiaTranUIT 👍 you are right !!thx !
@NghiaTranUIT commented on GitHub (Sep 4, 2020):
In the next build, I will add
rawBodyintorequestandresponse. Thus, you can get the raw body without depending on Content-Type, then you can parse whatever you like 👍 😄@trycatchx commented on GitHub (Sep 4, 2020):
@NghiaTranUIT Looking forward to next version!
@NghiaTranUIT commented on GitHub (Sep 10, 2020):
Good news that I supported
rawBodyin the request and response objects @zhangchaojiongIt's a raw String or Base64 encoded String (for binary data), then you can manually parse it 👍
https://docs.proxyman.io/scripting/script
@trycatchx commented on GitHub (Sep 22, 2020):
@NghiaTranUIT Happy to hear it!! 👍