rest-assured/src/main/java/io/restassured/builder/RequestSpecBuilder.java
public RequestSpecBuilder setBody(Object object, ObjectMapper mapper) {
        spec.body(object, mapper);
        return this;
    }
public RequestSpecBuilder setBody(Object object, ObjectMapper mapper) {
        spec.body(object, mapper);
        return this;
    }
public RequestSpecBuilder setBody ( Object object , ObjectMapper mapper ) { spec . body ( object , mapper ) ; return this ; }
Specify an Object request content that will automatically be serialized to JSON or XML and sent with the request using a specific object mapper.
This works for the POST, PATCH and PUT methods only. Trying to do this for the other http methods will cause an exception to be thrown.

@param object The object to serialize and send with the request
@param mapper The object mapper
@return The request specification
Specify an Object request content that will automatically be serialized to JSON or XML and sent with the request using a specific object mapper . This works for the POST PATCH and PUT methods only . Trying to do this for the other http methods will cause an exception to be thrown .