mirror of
https://github.com/ProxymanApp/Proxyman.git
synced 2026-04-26 16:45:57 +03:00
[GH-ISSUE #741] Request: Add response data to imported JSON or option to autosave JSON response to directory #737
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#737
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 @Alan-Holmes-Mimi on GitHub (Dec 23, 2020).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/741
Originally assigned to: @NghiaTranUIT on GitHub.
Proxyman version? Version 2.15.1 (21510)
macOS Version? 10.15.7
Feature request:
@NghiaTranUIT commented on GitHub (Dec 25, 2020):
Hi @Alan-Holmes-Mimi, just like to clarify that you need some way to save the response body to the file in the Scripting Tool? 🤔
For instance, it might look like:
context.export(body, "~/Desktop/my_response.txt")It will write the body as a file with given path
@4nif commented on GitHub (Dec 25, 2020):
I like this idea, maybe with
context.importto @NghiaTranUIT 👍 so we can use it to import json payload or http header from file without clicking import menu --> search the file@NghiaTranUIT commented on GitHub (Dec 25, 2020):
context.export(body, file_url)seems to be useful for automation tasks, so I will implement it soon. For theimport, I will consider supporting it soon since the workload doesn't seem easy 😅@Alan-Holmes-Mimi commented on GitHub (Dec 25, 2020):
Wow that seems like something that would definitely work for my purpose. I would essentially be looking to get around no API for catching a response, to trigger my assertion once I get a 200 from response. So within my automation framework I could read read the JSON and assert it contains 200 in response, then move on to the next step! Thanks for reponses!
@NghiaTranUIT commented on GitHub (Dec 31, 2020):
Hey @Alan-Holmes-Mimi @4nif, let check out this beta build: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_2.15.2_Write_To_File.dmg
From now, you can write down the body of the request/response to a file with
writeToFile(data, "~/desktop/myfile.txt")For instance,
@Alan-Holmes-Mimi commented on GitHub (Dec 31, 2020):
@NghiaTranUIT Works like a charm! No issues when overwriting files either which is nice!
@Alan-Holmes-Mimi commented on GitHub (Dec 31, 2020):
would it be possible to push the raw data that includes the HTTP response status code. Or to allow the response/request.statuscode/status so it is possible to assert a 500/200 response code?
@Alan-Holmes-Mimi commented on GitHub (Dec 31, 2020):
Actually @NghiaTranUIT I believe there is no need to complicate anything. I just converted status code to string. My own oversight!
This feature will eliminate the need for hard coded waits in my own automation framework!
@amorphius commented on GitHub (Jan 1, 2021):
@NghiaTranUIT writing is great! And how can I read from the file?
@NghiaTranUIT commented on GitHub (Jan 2, 2021):
@amorphius let click on the Import File button in the Scripting Window (https://docs.proxyman.io/scripting/snippet-code#json) 👍
@NghiaTranUIT commented on GitHub (Jan 2, 2021):
Awesome, glad to hear that @Alan-Holmes-Mimi 😄
@amorphius commented on GitHub (Jan 2, 2021):
I mean how can I read file with generated filename?
Will this work?
@NghiaTranUIT commented on GitHub (Jan 3, 2021):
Please export the file to
~/Library/Application Support/com.proxyman.NSProxy/users/, then you can import it by using:@users is the folder:
~/Library/Application Support/com.proxyman.NSProxy/users. At the moment, Proxyman is only capable of importing from@usersfolder.@amorphius commented on GitHub (Jan 3, 2021):
@NghiaTranUIT hmm, that's a bit weird. So I can write file to any folder but cannot read it? Is it impossible to implement or just wasn't implemented yet?
@NghiaTranUIT commented on GitHub (Jan 3, 2021):
It's possible, but we hasn't implemented it yet 😄
@NghiaTranUIT commented on GitHub (Jan 3, 2021):
To work around, please follow my example. I will support import "everywhere" soon 👍
@amorphius commented on GitHub (Jan 3, 2021):
@NghiaTranUIT I see, thanks!
@justaguywhocodes commented on GitHub (Mar 30, 2022):
One thought would be to have a shortcut monitor the folder for changes and then process the HTTP request via GetUrlContents function within Shortcuts. JXA/AppleScript is another possibility.
@jamesdh commented on GitHub (Oct 5, 2022):
Was there ever any way added to read the contents of a file? Currently
writeToFileoverwrites the file every time, but I'd like some way to append to the same file.@NghiaTranUIT commented on GitHub (Oct 5, 2022):
@jamesdh if you're using Proxyman 3.6.2+, you can provide an option to append the file, instead of overridden.
Ref: https://docs.proxyman.io/scripting/snippet-code#write-export-to-a-local-file
@jamesdh commented on GitHub (Oct 5, 2022):
@NghiaTranUIT You just got yourself a paying customer, and/or possibly a paying team. Thank you!
@NghiaTranUIT commented on GitHub (Oct 5, 2022):
Wow I appreciate it 😆