Package kong.unirest

Interface RequestBodyEntity

    • Method Detail

      • body

        RequestBodyEntity body​(byte[] bodyBytes)
        Set a byte array as the body of the request
        Parameters:
        bodyBytes - the byte[]
        Returns:
        this request builder
      • body

        RequestBodyEntity body​(String bodyAsString)
        Set a String as the body of the request
        Parameters:
        bodyAsString - the String
        Returns:
        this request builder
      • body

        RequestBodyEntity body​(JsonNode jsonBody)
        Set JSON on the body
        Parameters:
        jsonBody - the JsonNode
        Returns:
        this request builder
      • body

        RequestBodyEntity body​(Object body)
        Set a Object as the body of the request. This will be serialized with one of the following methods: - Strings are native - JSONElements use their native toString - Everything else will pass through the supplied ObjectMapper
        Parameters:
        body - the Object
        Returns:
        this request builder
      • charset

        RequestBodyEntity charset​(Charset charset)
        Set the Charset encoding for the Content-Type. This is appended to the Content-Type Header (e.g. application/x-www-form-urlencoded; charset=US-ASCII) Default is UTF-8
        Parameters:
        charset - the charset
        Returns:
        this request builder
      • noCharset

        default RequestBodyEntity noCharset()
        Removes any Charset for the Content-Type for when servers cannot process it. (e.g. application/x-www-form-urlencoded)
        Returns:
        this request builder
      • contentType

        RequestBodyEntity contentType​(String type)
        Parameters:
        type - The content mime type
        Returns:
        this request builder