Class HTTPFormBody

  • All Implemented Interfaces:

    
    public final class HTTPFormBody
    extends RequestBody
                        

    Represents the body of a network request containing form data.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final Map<String, ?> payload
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Map<String, ?> getPayload() The form data payload as a map of key-value pairs.
      Unit writeToStream(BufferedSink bufferedSink) Writes the URL-encoded form data to the provided BufferedSink.
      String getContentType() Gets the content type for URL-encoded form data.
      BufferedSource getSource() Gets a BufferedSource for reading the URL-encoded form data.
      • Methods inherited from class com.inmobi.media.network.okhttp.entity.body.RequestBody

        getEncoding
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HTTPFormBody

        HTTPFormBody(Map<String, ?> payload, Integer encoding)
        Parameters:
        encoding - The encoding of the 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.