mirror of
https://github.com/ProxymanApp/Proxyman.git
synced 2026-04-26 08:35:53 +03:00
[GH-ISSUE #946] Add "Don’t wait for Response" (Mock API) for scripts #941
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#941
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 @mprice-banno on GitHub (Jul 29, 2021).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/946
Originally assigned to: @NghiaTranUIT on GitHub.
Proxyman version? (Ex. Proxyman 1.4.3)
2.30.0 (23000)
macOS Version? (Ex. mac 10.14)
11.4
Issue
Currently it is not possible to use a mapped response, for example map to local, and then modify that response based on the request. The usage example is updating a JWT authentication token that is in the local mapped response, but that has expired and can be obtained from the request.
Feature request to add "Don't wait for response" to the scripting configurations for an endpoint. This would allow users to create a response through
function onResponse()without having to wait for the server to actually respond. This would be useful when mocking an endpoint that has not been deployed yet, or to speed up testing on a slow endpoint, and still allow the user to make changes to the response based on anything from the request.Screenshots (optional)
@NghiaTranUIT commented on GitHub (Aug 13, 2021):
Hey @mprice-banno please check out this beta build: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_2.31.0_Scripting_Mock_APIs.dmg
From now, you can use Scripting as a Mock API. The request would not go to the server, it will return intermediately 👍
To enable it, please select your Script -> Click on Option button -> Check Use onResponse() as Mock API.
Then defining your response.
Documentation: https://docs.proxyman.io/scripting/script#8-use-scripting-as-a-mock-api
Please let me know if it works for you 😄
@mprice-banno commented on GitHub (Aug 19, 2021):
@NghiaTranUIT Thanks!! I've only had a chance to briefly play with this so far, but it's working for me so far! Great idea having the "empty" response include the info message:
{ "httpVersion": "HTTP/1.1", "statusCode": 200, "statusPhrase": "OK", "body": { "comment": "To disable it: Select your script -> More button -> Uncheck Use onResponse() as Mock API", "scriptName": "Untitled", "description": "It's a Mock Response template. You can modify the Response data on onResponse() function." }, "rawBody": "{\n \"description\": \"It's a Mock Response template. You can modify the Response data on onResponse() function.\",\n \"comment\": \"To disable it: Select your script -> More button -> Uncheck Use onResponse() as Mock API\",\n \"scriptName\": \"Untitled\"\n}", "headers": { "Content-Type": "application/json" } }