com.marklogic.http

## Class HttpChannel

- java.lang.Object
- - com.marklogic.http.HttpChannel

-     public class HttpChannel
      extends java.lang.Object

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `HttpChannel.MultipartFormBody` Utilities for generating POST request body for multipart/form-data Example boundary: ------------------------933ed83bed2bbd3c Example form body: --------------------------933ed83bed2bbd3c Content-Disposition: form-data; name="key" -Z30HIE1I9xvUfwcXyLlHA== --------------------------933ed83bed2bbd3c Content-Disposition: form-data; name="grant_type" apikey --------------------------933ed83bed2bbd3c--

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `RCV_TIME_HEADER`
    `static java.lang.String` | `USEHTTP_PROPERTY_NAME`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HttpChannel(java.nio.channels.ByteChannel channel, java.lang.String method, java.lang.String path, int bufferSize, int timeoutMillis, java.util.logging.Logger logger)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `addPathSegment(java.lang.StringBuffer sb, java.lang.String seg)`
    `static java.lang.String` | `buildHttpPath(java.lang.String serverPath, java.lang.String basePath)`
    `int` | `getBufferSize()`
    `java.nio.channels.ByteChannel` | `getChannel()`
    `java.lang.String` | `getReponseCookieValue(java.lang.String key)`
    `java.lang.String` | `getRequestHeader(java.lang.String header)`
    `int` | `getResponseCode()`
    `java.lang.String` | `getResponseConnection()`
    `java.lang.String` | `getResponseContentBoundary()`
    `int` | `getResponseContentLength()`
    `java.lang.String` | `getResponseContentType()`
    `java.lang.String` | `getResponseContentTypeField(java.lang.String fieldName)`
    `java.lang.String` | `getResponseHeader(java.lang.String headerName)`
    `long` | `getResponseHeaderRecvTime()`
    `java.util.List<java.lang.String>` | `getResponseHeaders(java.lang.String headerName)`
    `com.fasterxml.jackson.databind.JsonNode` | `getResponseJsonBody()`
    `long` | `getResponseKeepaliveExpireTime()`
    `int` | `getResponseKeepaliveSeconds()`
    `java.lang.String` | `getResponseMessage()`
    `java.io.InputStream` | `getResponseStream()`
    `java.lang.String` | `getServerVersion()`
    `boolean` | `isResponseChunked()`
    `static boolean` | `isUseHTTP()`
    `void` | `reset(java.lang.String method, java.lang.String path)`
    `void` | `setCloseOutputIfNoContentLength(boolean value)`
    `void` | `setCommit(boolean val)`
    `void` | `setRequestContentLength(int length)`
    `void` | `setRequestContentType(java.lang.String value)`
    `void` | `setRequestHeader(java.lang.String header, java.lang.String value)`
    `static void` | `setUseHTTP(boolean val)`
    `void` | `suppressHeaders()`
    `int` | `write(byte[] bytes)`
    `int` | `write(byte[] bytes, int offset, int length)`
    `void` | `write(java.nio.ByteBuffer buffer)`
    `void` | `writeString(java.lang.String value)`

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

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

- - ### Field Detail

    - #### USEHTTP_PROPERTY_NAME

          public static final java.lang.String USEHTTP_PROPERTY_NAME

      See Also:
        Constant Field Values

    - #### RCV_TIME_HEADER

          public static final java.lang.String RCV_TIME_HEADER

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### HttpChannel

          public HttpChannel(java.nio.channels.ByteChannel channel,
                             java.lang.String method,
                             java.lang.String path,
                             int bufferSize,
                             int timeoutMillis,
                             java.util.logging.Logger logger)

  - ### Method Detail

    - #### isUseHTTP

          public static boolean isUseHTTP()

    - #### setUseHTTP

          public static void setUseHTTP(boolean val)

    - #### setCommit

          public void setCommit(boolean val)

    - #### reset

          public void reset(java.lang.String method,
                            java.lang.String path)

    - #### getChannel

          public java.nio.channels.ByteChannel getChannel()

    - #### setCloseOutputIfNoContentLength

          public void setCloseOutputIfNoContentLength(boolean value)

    - #### write

          public int write(byte[] bytes,
                           int offset,
                           int length)
                    throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### write

          public int write(byte[] bytes)
                    throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### writeString

          public void writeString(java.lang.String value)
                           throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### write

          public void write(java.nio.ByteBuffer buffer)
                     throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getResponseStream

          public java.io.InputStream getResponseStream()
                                                throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### setRequestHeader

          public void setRequestHeader(java.lang.String header,
                                       java.lang.String value)

    - #### getRequestHeader

          public java.lang.String getRequestHeader(java.lang.String header)

    - #### setRequestContentType

          public void setRequestContentType(java.lang.String value)

    - #### setRequestContentLength

          public void setRequestContentLength(int length)

    - #### getResponseHeader

          public java.lang.String getResponseHeader(java.lang.String headerName)
                                             throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getResponseHeaders

          public java.util.List<java.lang.String> getResponseHeaders(java.lang.String headerName)
                                                              throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getResponseCode

          public int getResponseCode()
                              throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getResponseMessage

          public java.lang.String getResponseMessage()
                                              throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getResponseContentLength

          public int getResponseContentLength()
                                       throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getResponseContentType

          public java.lang.String getResponseContentType()
                                                  throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getResponseContentTypeField

          public java.lang.String getResponseContentTypeField(java.lang.String fieldName)
                                                       throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getResponseContentBoundary

          public java.lang.String getResponseContentBoundary()
                                                      throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getReponseCookieValue

          public java.lang.String getReponseCookieValue(java.lang.String key)
                                                 throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### isResponseChunked

          public boolean isResponseChunked()
                                    throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getResponseHeaderRecvTime

          public long getResponseHeaderRecvTime()
                                         throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getResponseKeepaliveExpireTime

          public long getResponseKeepaliveExpireTime()
                                              throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getResponseKeepaliveSeconds

          public int getResponseKeepaliveSeconds()
                                          throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getResponseConnection

          public java.lang.String getResponseConnection()
                                                 throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getResponseJsonBody

          public com.fasterxml.jackson.databind.JsonNode getResponseJsonBody()
                                                                      throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### suppressHeaders

          public void suppressHeaders()

    - #### getServerVersion

          public java.lang.String getServerVersion()
                                            throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getBufferSize

          public int getBufferSize()

    - #### buildHttpPath

          public static java.lang.String buildHttpPath(java.lang.String serverPath,
                                                       java.lang.String basePath)

    - #### addPathSegment

          public static void addPathSegment(java.lang.StringBuffer sb,
                                            java.lang.String seg)

Copyright © 2025 MarkLogic Corporation

Complete online documentation for MarkLogic Server, XQuery and related components may be found at docs.progress.com