Forum Discussion
Having read through some further ReadyAPI Documentation, I see that the text area below the Media Type (application/json) dropdown is called the "Content Editor".
Is this where the json request body arguments should be set? I.e. rather than as request parameters under the Parameter editor?
HEADERS = {'apitoken': XXXX}
resp = requests.post(
url= 'https://xxxx.xxxxxxx.com/rest/xxxx/search'
data={'name': nameArg, 'country': countryArg},
headers=HEADERS
)
I.e. for the JSON example I am trying to simulate/test (above) in ReadyAPI, should I be entering the following under the "Content Editor", instead of adding them as request parameters?
{'name': NameArg, 'country': CountryArg}
Yes it seems that the name/country data would be included in the content editor so you don't need name/country parameters.
There is a JSON request example in https://support.smartbear.com/readyapi/docs/projects/ui/request/request/vertical/rest.html
The Raw panel is also useful to see the actual request that was sent
https://support.smartbear.com/readyapi/docs/projects/ui/request/request/vertical/raw.html
Authorization can be different for any request
https://support.smartbear.com/readyapi/docs/projects/requests/auth/index.html
- tgunasek9 years agoNew Contributor
Thank you both for your comments. I found the RAW panel to be quite useful while testing.
I've now managed to setup and test the two REST services with a JSON Request, returning a JSON Response.