Re:Show HN: Open source Postman alternative with type safety
by asmor on Wednesday September 06, 2023 @04:19AM
(#37402555)
The one piece of Postman that only Hoppscotch (a Postman fork) seems replicate that I definitely want is scripting. Often requests depend upon data from another, and being able to put things into the environment as you run different requests is super useful (even if you just use it for otherwise unsupported auth methods).
[ Parent
| on HN ]
Re:Show HN: Open source Postman alternative with type safety
by jve on Wednesday September 06, 2023 @04:40AM
(#37402698)
I didn't quite understand if you are aware, but Postman has scripting and can depend upon data from another. And even can query it serially if you add requests to folder, right click on folder and "Run folder".
Scripting is under Tests tab.
I've built oauth2 authorization flow to get the code and afterwards the access token.
First request Test script:
pm.expect(pm.response.code).to.equal(302);
var code = pm.response.body;
var location = pm.response.headers.get("Location");
if (location.match(/\\?code=([^&]+)/) === null) {
postman.setNextRequest(pm.info.requestName)
console.log("Request must be re-run. First time adfs wants to set some cookies, eh.")
} else {
var code = location.match(/\\?code=([^&]+)/)[1];
pm.environment.set("oauth2_authorizationcode", code);
}
Second request Test script: pm.environment.set("oauth2_accesstoken", pm.response.json().access_token);
pm.environment.set("oauth2_refreshtoken", pm.response.json().refresh_token);
Scripting: https://learning.postman.com/docs/writing-scripts/script-ref...
Re:Show HN: Open source Postman alternative with type safety
by croes on Wednesday September 06, 2023 @06:24AM
(#37403276)
That's why parent wrote that Hopscotch is the only solution which replicated Postman scripting.
>The one piece of Postman that only Hoppscotch (a Postman fork) seems replicate that I definitely want is scripting.
Parent is talking about the lack of scripting in Postman alternatives.
Re:Show HN: Open source Postman alternative with type safety
by ushakov on Wednesday September 06, 2023 @09:02AM
(#37404494)
Hoppscotch is not a Postman fork as far as I know.
You can do request chaining with Step CI (https://stepci.com) and Hurl (https://hurl.dev)
Re:Show HN: Open source Postman alternative with type safety
by rabbah on Wednesday September 06, 2023 @12:06PM
(#37407115)
or use Postman Flows https://learning.postman.com/docs/postman-flows/gs/flows-ove...