How to create a new Body json field with combining all active keys in x-www-form-urlencoded

Hi guys,

There is a request with active x-www-form-urlencoded Body key. The key value is in JSON format. There are also not enabled keys that can be used to send different Body values.

Due to large Body size it would be more convenient if I could enter each JSON key separately in x-www-form-urlencoded and process in Pre-request Script by combining all active keys to a new Body JSON field before sending the request.

Is it possible?


Hi @osiuser

Not sure I follow exactly what your are trying to do, but could you not just add the list of values you need to the body > x-www-form-urlencoded tab?


To send a request I have to add “Body” key on that screen. The value of this key is in JSON format and can be large enough due to many elements included.

What I want to do is to avoid using the “Body” key and rather to use separate small keys. But because the “Body” key in the request Body is mandatory for the call I need somehow to process all Active keys (because some can be inactive) and combine from them the required “Body” field before sending the request. And do it behind the scene like Pre-request Script does.

For example,

sends this in the Request Body


And I want it to be sent as


Hmm, ok …

So if you have the JSON for the ‘body’ Key … could you not stringify that JSON in the pre-req script and then feed it in as a variable?

Similar to what is described in this thread?

Sorry, I don’t understand what you suggested. The article you referenced uses an Environmental variable in Raw body. But I use x-www-form-urlencoded Body keys.

If you know what the “key”:“value” pairs are, could you build a list of variables that hold these values, then build the JSON inside the pre-req, url-econde the string and then feed that into your script. It means you could pick the values you want to use from your pre-defined list.

Unless I have misunderstood what you are trying to achieve, in which case could you provide a bit more information?

My understanding Postman takes all enabled keys to created the request Body and send the request.

What I need is:

  • Combine all enabled keys to a new key “Body”
  • Don’t remove the existing keys or adding a new keys in UI
  • I want Postman to send the request by sending ONLY this new key “Body”