Authorization header fields

Hey guys

I am currently working with rest api / http requests and I figured out i’d better use Postman to test if i can connect to other server’s API.
Never used Postman before so got stuck.

That’s my JS code:

const ts = (;
const nonce = (Number(*77).toString();
const httpreqmet = "POST";
const httprequri = "/v2/sms";
const httphost = "";
const httpport = "443";
const httpopdata = "";
const lf = "\n"
const longstring = ts+lf+nonce+lf+httpreqmet+lf+httprequri+lf+httphost+lf+httpport+lf+httpopdata+lf;

How can I add longstring as variable on pre request script on Postman?

I have done the easiest part:

pm.globals.set(“ts”, “(”);
pm.globals.set(“nonce”, “(Number(*77).toString()”);
pm.globals.set(“httpreqmet”, “POST”);
pm.globals.set(“httprequri”, “/v2/sms”);
pm.globals.set(“httphost”, “”);
pm.globals.set(“httpport”, “443”);
pm.globals.set(“httpopdata”, “”);
pm.globals.set(“lf”, “\n”);

should var longstring be:

pm.globals.set(“longstring”, pm.globals.get(ts)+pm.globals.get(lf)+pm.globals.get(nonce ) etc etc);


Hi @smnkv

This link might help you with variables;

To get one long string, you would just drop your JS in the prereq tab like this;

I’m not sure that gives you the expected output though…