Class RequestBody
-
- All Implemented Interfaces:
public class RequestBodyRepresents the body of a network request.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public @interfaceRequestBody.ContentTypeAnnotation class defining the possible content types for the request body.
public @interfaceRequestBody.EncodingAnnotation class defining the possible encodings for the request body.
-
Method Summary
Modifier and Type Method Description abstract UnitwriteToStream(BufferedSink bufferedSink)Writes the request body to the provided BufferedSink. abstract StringgetContentType()Retrieves the content type of the request body. IntegergetEncoding()Retrieves the encoding of the request body. abstract BufferedSourcegetSource()Retrieves the source of the request body. -
-
Method Detail
-
writeToStream
abstract Unit writeToStream(BufferedSink bufferedSink)
Writes the request body to the provided BufferedSink.
- Parameters:
bufferedSink- The sink to write the request body to.
-
getContentType
abstract String getContentType()
Retrieves the content type of the request body.
- Returns:
The content type.
-
getEncoding
Integer getEncoding()
Retrieves the encoding of the request body.
- Returns:
The encoding.
-
getSource
abstract BufferedSource getSource()
Retrieves the source of the request body.
- Returns:
The source.
-
-
-
-