Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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...


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: