cancel
Showing results for 
Search instead for 
Did you mean: 

How to: POST REST request with JSON body (SoapUI Pro 4.6.1)

Highlighted
New Contributor

How to: POST REST request with JSON body (SoapUI Pro 4.6.1)

I need to POST to a REST endpoint a request with a JSON body, like




POST http://server/service/method


Content-Type: application/json


 




{ "hi" : "there" }



How can I do that?



2 REPLIES 2
Highlighted
Community Manager

RE: How to: POST REST request with JSON body (SoapUI Pro 4.6.1)


Hi Ed,


 


Refer to this SoapUI article. If it doesn't help, please repost your question in the SoapUI forum (this is the TestComplete forum).


 

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Highlighted
New Member

Re: RE: How to: POST REST request with JSON body (SoapUI Pro 4.6.1)

Hi ...

 

I'm a newbie in using ReadyAPI 

Blocked in here - trying to send "different sets of data" in json body using data source and data loop (Post method, REST web service)

One set of data in JSON body - all works well using post method for Rest service

Data source works fine as well BUT the issue arises when I use 'GetData' in json body and a data source loop
My JSON:

{ 'Topic' : 'EventName', 'Message' : ' { "EventAttribute" : Eventdata } ' } -

 

After setting up data source and data source loop, cleared the event data and right click and use 'GetData' to point to 'DataSource'

 

Result: only the last row in the data source feeds to event data and completes the test

 

 

New Here?
Join us and watch the welcome video:
Announcements
Script Wanted
Let's start July with new challenges!

Create a script to change request body before sending it to the server for the TechCorner tag!


Scripts created in June:
- A script to generate a request body based on data from Datasource
- A script to go through all response nodes and check the value of the required field
- A Dispatching script to get responses based on the values in Request Body
- A script to add a new tag and assign it to all TestCases in a TestSuite