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.
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.
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?