Forum Discussion
PrathapR
4 years agoFrequent Contributor
Hey swetakumar
I don't think we can add request body for "GET". It should not have body by the definition, It should fetch data by using Query, Path parameters and Headers.
If we have to pass request body, need to add your REST resource(end point) as "POST" (If it's POST), then will see window to add request body.
Thanks!
- richie4 years agoCommunity HeroHi swetakumar,
The reason why it appears you can submit a payload in a GET request in Postman is cos theres no context relative to the method selected in Postman whereas there is in soapui/soapui pro/readyapi!
The RFCs that describe http methods are vague in places but are clear on this point that they dont expect payloads to be submitted using GET. If you want to retrieve data and pass a payload the RFCs suggest using POST instead.
However, if you have the licensed version of soapui pro or readyapi you can make a config update to enable a payload field to appear for the GET method. There was another post recently where someone else asked the same question and one of the SmartBear staff respondef with the config entry change (i think it goes in the vmoptions file).
The config change does NOT work for open source soapui but does work for pro/readyapi version according to what the SB staff memner stated in the post. If you have a search you should be able to find it.
Ta
Rich- swetakumar4 years agoOccasional Contributor
I figured it out another solution. I can add a JSON body as a parameter in the value field with the Type 'Plain'.
- richie4 years agoCommunity HeroHey swetakumar,
Can you just explain what youve done please, cos you say youve managed to add a json body as a parameter type using the PLAIN option, but that isnt how that functionality works at all.
Setting a parm to PLAIN (from one of the other options stops the parm appearing in your request) it shouldnt support adding a payload to a parm in the request at all.
Ta
Rich
Related Content
- 2 years ago