Interface MultipartBody

    • Method Detail

      • field

        MultipartBody field​(String name,
                            String value)
        add a simple field with a name and value
        Parameters:
        name - : the Name of the form field
        value - : The string value for the field
        Returns:
        The same MultipartBody
      • field

        MultipartBody field​(String name,
                            String value,
                            String contentType)
        add a simple field with a name and value
        Parameters:
        name - : the Name of the form field
        value - : The string value for the field
        contentType - : the content type of the value
        Returns:
        The same MultipartBody
      • field

        MultipartBody field​(String name,
                            String value,
                            ContentType contentType)
        add a simple field with a name and value
        Parameters:
        name - : the Name of the form field
        value - : The string value for the field
        contentType - : the content type of the value
        Returns:
        The same MultipartBody
      • field

        MultipartBody field​(String name,
                            Collection<?> values)
        add a simple field with a name and value
        Parameters:
        name - : the Name of the form field
        values - : A collection of values for the same name.
        Returns:
        The same MultipartBody
      • field

        MultipartBody field​(String name,
                            File file)
        add a simple field with a name and value
        Parameters:
        name - : the Name of the form field
        file - : A File object.
        Returns:
        The same MultipartBody
      • field

        MultipartBody field​(String name,
                            File file,
                            String contentType)
        add a simple field with a name and value
        Parameters:
        name - : the Name of the form field
        file - : A File object.
        contentType - : the content mime-type of the file
        Returns:
        The same MultipartBody
      • field

        MultipartBody field​(String name,
                            InputStream value,
                            ContentType contentType)
        add a simple field with a name and value
        Parameters:
        name - : the Name of the form field
        value - : A input stream
        contentType - : the content mime-type of the file
        Returns:
        The same MultipartBody
      • field

        MultipartBody field​(String name,
                            InputStream stream,
                            ContentType contentType,
                            String fileName)
        add a simple field with a name and value
        Parameters:
        name - : the Name of the form field
        stream - : A input stream
        contentType - : the content mime-type of the file
        fileName - : the name of the file which will be included in the file part header
        Returns:
        The same MultipartBody
      • field

        MultipartBody field​(String name,
                            byte[] bytes,
                            ContentType contentType,
                            String fileName)
        add a simple field with a name and value
        Parameters:
        name - : the Name of the form field
        bytes - : The raw bytes for the file
        contentType - : the content mime-type of the file
        fileName - : the name of the file which will be included in the file part header
        Returns:
        The same MultipartBody
      • field

        MultipartBody field​(String name,
                            InputStream stream,
                            String fileName)
        add a simple field with a name and value
        Parameters:
        name - : the Name of the form field
        stream - : The raw bytes for the file
        fileName - : the name of the file which will be included in the file part header
        Returns:
        The same MultipartBody
      • field

        MultipartBody field​(String name,
                            byte[] bytes,
                            String fileName)
        add a simple field with a name and value
        Parameters:
        name - : the Name of the form field
        bytes - : The raw bytes for the file
        fileName - : the name of the file which will be included in the file part header
        Returns:
        The same MultipartBody
      • charset

        MultipartBody charset​(Charset charset)
        Set the encoding of the request body
        Parameters:
        charset - the character set encoding of the body
        Returns:
        The same MultipartBody
      • contentType

        MultipartBody contentType​(String mimeType)
        Set the mime-type of the request body
        Parameters:
        mimeType - the mime type of the body
        Returns:
        The same MultipartBody
      • mode

        MultipartBody mode​(MultipartMode value)
        Set the Apache Mode.
        Parameters:
        value - the value of the mode
        Returns:
        The same MultipartBody
      • uploadMonitor

        MultipartBody uploadMonitor​(ProgressMonitor monitor)
        Set a file Progress upload monitor suitable for drawing progress bars and whatnot.
        Parameters:
        monitor - a monitor
        Returns:
        The same MultipartBody
      • boundary

        MultipartBody boundary​(String boundaryIdentifier)
        Sets the value to use as the boundary identifier. see https://datatracker.ietf.org/doc/html/rfc2046
        Parameters:
        boundaryIdentifier - the value
        Returns:
        The same MultipartBody