Class HTTPFormBody
-
- All Implemented Interfaces:
public final class HTTPFormBody extends RequestBody
Represents the body of a network request containing form data.
-
-
Constructor Summary
Constructors Constructor Description HTTPFormBody(Map<String, ?> payload, Integer encoding)
-
Method Summary
Modifier and Type Method Description final Map<String, ?>getPayload()The form data payload as a map of key-value pairs. UnitwriteToStream(BufferedSink bufferedSink)Writes the URL-encoded form data to the provided BufferedSink. StringgetContentType()Gets the content type for URL-encoded form data. BufferedSourcegetSource()Gets a BufferedSource for reading the URL-encoded form data. -
-
Method Detail
-
getPayload
final Map<String, ?> getPayload()
The form data payload as a map of key-value pairs.
-
writeToStream
Unit writeToStream(BufferedSink bufferedSink)
Writes the URL-encoded form data to the provided BufferedSink.
- Parameters:
bufferedSink- The sink to write the form data to.
-
getContentType
String getContentType()
Gets the content type for URL-encoded form data.
- Returns:
The content type string, typically "application/x-www-form-urlencoded".
-
getSource
BufferedSource getSource()
Gets a BufferedSource for reading the URL-encoded form data.
- Returns:
A BufferedSource containing the form data.
-
-
-
-