Forum Discussion

CBS_Interactive_1's avatar
CBS_Interactive_1
Occasional Contributor
14 years ago

Passing REST Parameters in the body of the request in JSON

I am trying to test a REST service and have come across what appears to be a limitation with SOAP UI Pro. Our service was initially setup to accept a REST request via query string. However, it has since been refactored to pass the parameters in the body of the request in either JSON or XML format instead. Initially, I was elated to find the Post QueryString feature that allowed the Method Parameters I had created for each call to be injected into the body of the request. Unfortunately, as the feature's title suggests it is injected in QueryString format, which is not supported by our service. Presently, when the Post QueryString option is selected it defaults to Media Type "application/x-www-form-urlencoded" and is uneditable. Does anyone know of a way to have SoapUI inject the method parameters into the body of the request in JSON format?

Example:

Initial Setup
URL: api.company.com/login.json?param1=true&param2=false

Post QueryString Format
URL: api.company.com/login.json
Body: param1=true&param2=false

Required Format
URL: api.company.com/login.json
Body:
{
"param1":"true",
"param2":"false"
}

Not sure if this is a bug as much as it's a feature request but any help would be greatly appreciated!

Thanks in advance!
No RepliesBe the first to reply