News for hackers. Stuff that matters.
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.