mirror of
https://github.com/ProxymanApp/Proxyman.git
synced 2026-04-26 16:45:57 +03:00
[GH-ISSUE #891] Modify response body snippet #885
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#885
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 @Floperoid on GitHub (May 15, 2021).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/891
Originally assigned to: @NghiaTranUIT on GitHub.
I want to modify response using Scripting tool. My response is complicated json with nested objects and arrays that looks like that
payload: {
...........
result{
........
value[
.......
"something_i_want_to_change":"123",
.......
]
.........
}
}
How can I replace "123" value to "321"?
@NghiaTranUIT commented on GitHub (May 15, 2021):
Hey @Floperoid, since the body is an Object (Dictionary), so you can access the value as usual. For example:
If it's too difficult to access a child node from a large JSON, you can export your Response first (Right-click on the Flow -> Export Response Body)
Then set a
response.bodyFilePathas a file path.Then, you can easily edit the JSON file with your favorited editor (VS Code or Sublime) 👍
Ref: https://docs.proxyman.io/scripting/snippet-code#map-a-local-file-to-responses-body-like-map-local-tool-proxyman-2-25-0
@Floperoid commented on GitHub (May 15, 2021):
Thank you a lot! Turns out It was my inadvertence