Interface RestTestClient.RequestBodySpec
- All Superinterfaces:
RestTestClient.RequestHeadersSpec<RestTestClient.RequestBodySpec>
- All Known Subinterfaces:
RestTestClient.RequestBodyUriSpec
- Enclosing interface:
RestTestClient
public static interface RestTestClient.RequestBodySpec
extends RestTestClient.RequestHeadersSpec<RestTestClient.RequestBodySpec>
Specification for providing the body of a request.
- Since:
- 7.0
- Author:
- Rob Worsnop, Rossen Stoyanchev
-
Method Summary
Modifier and TypeMethodDescriptionSet the body to the givenObject
value.contentLength
(long contentLength) Set the length of the body in bytes, as specified by theContent-Length
header.contentType
(MediaType contentType) Set the media type of the body, as specified by theContent-Type
header.Methods inherited from interface RestTestClient.RequestHeadersSpec
accept, acceptCharset, apiVersion, attribute, attributes, cookie, cookies, exchange, header, headers, ifModifiedSince, ifNoneMatch
-
Method Details
-
contentLength
Set the length of the body in bytes, as specified by theContent-Length
header.- Parameters:
contentLength
- the content length- Returns:
- this spec for further declaration of the request
- See Also:
-
contentType
Set the media type of the body, as specified by theContent-Type
header.- Parameters:
contentType
- the content type- Returns:
- this spec for further declaration of the request
- See Also:
-
body
Set the body to the givenObject
value. This method invokes theRestClient.RequestBodySpec.body(Object)
(Object) bodyValue} method on the underlyingRestClient
.- Parameters:
body
- the value to write to the request body- Returns:
- a spec for further declaration of the request
-