cancel
Showing results for 
Search instead for 
Did you mean: 

Can I input the JSON raw data on the Raw tab instead of adding each key-value pair under Parameters?

SOLVED
Highlighted
New Contributor

Can I input the JSON raw data on the Raw tab instead of adding each key-value pair under Parameters?

I have an endpoint that supports a POST with 20 key-value pairs on the body. 

 

Is there a way to directly type raw JSON data on the "Raw" tab instead of having to add each key-value pair manually as a Parameter (and then selecting "Post QueryString")? 

 
 
 
 
2 ACCEPTED SOLUTIONS

Accepted Solutions
Contributor

Re: Can I input the JSON raw data on the Raw tab instead of adding each key-value pair under Paramet

From the SoapUI tab you can move the cursor to your Navigation window. Select the request. Your request editor window should appear on the right side. It has four tabs: request, raw, outline, and form. For request look at the "Media Type" in the window underneath. Choose "applicaiton/json" from the pull down menu.  In the space below you can type in your json

 

 

Disclaimer: I use Groovy script for this. In my case when I run my groovy, it leaves the json in the body of the request,. In my application I don't want that after I finish the request/response. So I delete the json content in an "aftertestcase" event handler. It seems once you got your json in the window below "Media Type" it will be there for future test runs.

Community Hero

Re: Can I input the JSON raw data on the Raw tab instead of adding each key-value pair under Paramet

It's just as Bill said.

 

rawJson.png



If my answer helped please click on the 'Accept as Solution' button.
3 REPLIES 3
Contributor

Re: Can I input the JSON raw data on the Raw tab instead of adding each key-value pair under Paramet

From the SoapUI tab you can move the cursor to your Navigation window. Select the request. Your request editor window should appear on the right side. It has four tabs: request, raw, outline, and form. For request look at the "Media Type" in the window underneath. Choose "applicaiton/json" from the pull down menu.  In the space below you can type in your json

 

 

Disclaimer: I use Groovy script for this. In my case when I run my groovy, it leaves the json in the body of the request,. In my application I don't want that after I finish the request/response. So I delete the json content in an "aftertestcase" event handler. It seems once you got your json in the window below "Media Type" it will be there for future test runs.

Community Hero

Re: Can I input the JSON raw data on the Raw tab instead of adding each key-value pair under Paramet

It's just as Bill said.

 

rawJson.png



If my answer helped please click on the 'Accept as Solution' button.
New Contributor

Re: Can I input the JSON raw data on the Raw tab instead of adding each key-value pair under Paramet

thank you @Bill_In_Irvine and @Lucian!

February News
Top Kudoed Authors