I need to set variables in below request body.
and i tried the x-www-form-urlencoded like below, it is poping up ‘unsupported media type’.
I need to set variables in below request body.
and i tried the x-www-form-urlencoded like below, it is poping up ‘unsupported media type’.
Hey @wangjing0125
Welcome to the Postman Community!
Without knowing what that API expects as a payload type (Raw JSON, Form-Data, Etc) it difficult to give you a working solution. Could you share any documentation you might be following?
One method you could use to add variables into a request body is to create the structure and data in a pre-request script, save that as a variable and then reference this in your payload body.
If you’re able to expand on the details of the request, we’ll be able to help you further.
Considering your first screenshots and that some elements are objects within object, I suspect this is raw\JSON.
Have you done through the Postman docs yet?
Using variables | Postman Learning Center
As this is fairly straight forward. Store you values as collection or environment variables and then reference them in the body using double curly brackets. {{variableName}}.
If you are new to Postman, then I would suggest a visit to the Learning Centre.
Overview | Postman Learning Center
Including the Postman Training links under “Other Resources”.
I would recommend the “Galaxy APIs 101” course first as it gets you used to the application features and the GUI.
Then the “Galaxy Testing and Automation” course which teaches you how to assert the responses. It includes defining and using variables from responses.
Pretty sure the body for your request should be raw\JSON, not x-www-form-urlencoded.
how should I do parameterization in a raw/JSON ? the other 2 parameters needs to be dynamic