Class RequestBody

  • All Implemented Interfaces:

    
    public class RequestBody
    
                        

    Represents the body of a network request.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public @interface RequestBody.ContentType

      Annotation class defining the possible content types for the request body.

      public @interface RequestBody.Encoding

      Annotation class defining the possible encodings for the request body.

    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Unit writeToStream(BufferedSink bufferedSink) Writes the request body to the provided BufferedSink.
      abstract String getContentType() Retrieves the content type of the request body.
      Integer getEncoding() Retrieves the encoding of the request body.
      abstract BufferedSource getSource() Retrieves the source of the request body.
      • Methods inherited from class java.lang.Object

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

    • 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.