How to make a post request using payload as a JSON file?

63 views
Skip to first unread message

Deepak Thayat

unread,
May 23, 2018, 10:27:35 AM5/23/18
to REST assured
Hi Folks,

As I came into situation where I want to make a post request with JSON (nested one) payload.

waiting for hearing you soon.


Thanks,
Deepak

Todd Bradley

unread,
May 23, 2018, 10:41:09 AM5/23/18
to rest-a...@googlegroups.com
This example from the online help shows how:

https://github.com/rest-assured/rest-assured/wiki/Usage#create-json-from-a-hashmap

given().
        contentType(JSON).
        body(jsonAsMap).
when().
        post("/somewhere").
then().
        statusCode(200);


--
You received this message because you are subscribed to the Google Groups "REST assured" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rest-assured+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages