最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Postman $GUID: Remove hyphens and make all character uppercase - Stack Overflow

programmeradmin4浏览0评论

Can someone help me to remove the hyphens and transform all characters to uppercase (from a postman $guid)?

Haven't find anything useful.

Thanks

Can someone help me to remove the hyphens and transform all characters to uppercase (from a postman $guid)?

Haven't find anything useful.

Thanks

Share Improve this question edited Oct 11, 2019 at 17:24 Danny Dainton 25.9k6 gold badges73 silver badges88 bronze badges asked Oct 11, 2019 at 16:21 NikNik 551 gold badge2 silver badges5 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 15

There are many hacky ways to do this in Postman, here's one of them:

let guid = pm.variables.replaceIn('{{$guid}}')

let formattedGuid = guid.replace(/-/g, '').toUpperCase()

pm.globals.set("newGuid", formattedGuid)

If you add that to the Pre-request Script, you'll be able to use it in the requests.

Or you can use the new postman guid generator {{newGuid}}

发布评论

评论列表(0)

  1. 暂无评论