How to compute a md5 hash in a pre-request script in PostMan?

前端 未结 2 356
执念已碎
执念已碎 2021-02-01 14:52

I have to set a parameter in my request that is a md5 hash of two other parameters. I think a pre-request script can do the job, but I do not know how to compute a md5 in this s

2条回答
  •  粉色の甜心
    2021-02-01 15:39

    FYI, since Postman 4.6.0+ you can no longer include external libraries with $.getScript calls and promise returns, as jQuery was depreciated in favour of Cheerio from 4.6.0.

    Therefore if you wish to include a third party library in your pre-request scripts, at present the only way to do so is storing the contents of the file in a environment variable and running eval() in your sript - see why here.

    For example:

    eval(postman.getEnvironmentVariable("JSSHA")); 
    

    There are however some libraries included with Postman that do not require this workaround, these are listed here.

提交回复
热议问题