Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post - form-data - Need to be able to programatically disable Key pairs during "Pre-request Script" #4693

Closed
BrianKilby opened this issue Jun 14, 2018 · 4 comments

Comments

@BrianKilby
Copy link

When using "Postman v6.1.3" (the latest version), we need to be able to programmatically disable Key pairs during "Pre-request Script" for Post - form-data - requests. Further, we would like to be able to add/delete Key pairs during the "Pre-request Script".

key fields for a post form-data request

@shamasis
Copy link
Member

Closing this and tracking it here #4808

We added mutating URLs and headers for requests ... mutating other parts like auth and body (to some extent) would follow in short to mid term. :-) Meanwhile, in UI we need to have ways to see what exactly was sent (since programmatic changes are hard to spot.)

Runtime Triage and Development automation moved this from Later to Ready Jun 21, 2019
@codenirvana
Copy link
Member

Postman v8.3.0 added support for programmatically mutating the request body.

The following pre-request script will remove/disable a form-param programmatically:

pm.request.body.formdata.remove('FirstName');

@jshearin01
Copy link

When I call "pm.request.body.formdata.remove(key);" I get "TypeError: Cannot read properties of undefined (reading 'remove')
"

@shubhbhargav
Copy link

@jshearin01 Can you please share the request / collection with us to help debug this further? You can share the same via email: help@postman.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

8 participants