javascriptpostmanpostman-pre-request-script

How to add request parameters for a postman request in pre-script request


I want to add query parameters for my request in postman through the pre-request script. How can I do this?


Solution

  • Something basic like this could be used in the Collection Pre-request Script:

    pm.request.url.query.add({key: 'test', value: '1234'})