org.apache.hc.client5.http.fluent

## Class Content

- java.lang.Object
- - org.apache.hc.client5.http.fluent.Content

-     public class Content
      extends Object

  This class represents arbitrary content of a specific type that can be consumed multiple times and requires no explicit deallocation used by the fluent facade.
  Since:
    4.2

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Content` | `NO_CONTENT`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Content(byte[] raw, org.apache.hc.core5.http.ContentType type)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `byte[]` | `asBytes()`
    `InputStream` | `asStream()`
    `String` | `asString()`
    `String` | `asString(Charset charset)`
    `org.apache.hc.core5.http.ContentType` | `getType()`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### NO_CONTENT

          public static final Content NO_CONTENT

  - ### Constructor Detail

    - #### Content

          public Content(byte[] raw,
                         org.apache.hc.core5.http.ContentType type)

  - ### Method Detail

    - #### getType

          public org.apache.hc.core5.http.ContentType getType()

    - #### asBytes

          public byte[] asBytes()

    - #### asString

          public String asString()

    - #### asString

          public String asString(Charset charset)

      Since:
        4.4

    - #### asStream

          public InputStream asStream()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 1999–2022 The Apache Software Foundation. All rights reserved.