org.apache.hc.core5.http.message

## Class MessageSupport

- java.lang.Object
- - org.apache.hc.core5.http.message.MessageSupport

-     public class MessageSupport
      extends Object

  Support methods for HTTP message processing.
  Since:
    5.0

- - ### Method Summary

    All Methods Static Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `addContentEncodingHeader(HttpMessage message, EntityDetails entity)`
    `static void` | `addContentTypeHeader(HttpMessage message, EntityDetails entity)`
    `static void` | `addTrailerHeader(HttpMessage message, EntityDetails entity)`
    `static boolean` | `canResponseHaveBody(String method, HttpResponse response)`
    `static Header` | `format(String name, Set<String> tokens)` Deprecated. Use `header(String, Set)`
    `static Header` | `format(String name, String... tokens)` Deprecated. use `header(String, String...)`
    `static void` | `formatElements(CharArrayBuffer dst, HeaderElement... elements)`
    `static void` | `formatElements(CharArrayBuffer dst, List<HeaderElement> elements)`
    `static void` | `formatParameters(CharArrayBuffer dst, List<NameValuePair> params)`
    `static void` | `formatParameters(CharArrayBuffer dst, NameValuePair... params)`
    `static void` | `formatTokens(CharArrayBuffer dst, List<String> tokens)`
    `static void` | `formatTokens(CharArrayBuffer dst, Set<String> tokens)`
    `static void` | `formatTokens(CharArrayBuffer dst, String... tokens)`
    `static Header` | `header(String name, HeaderElement... elements)`
    `static Header` | `header(String name, Set<String> tokens)`
    `static Header` | `header(String name, String... tokens)`
    `static Header` | `headerOfElements(String name, List<HeaderElement> elements)`
    `static Header` | `headerOfTokens(String name, List<String> tokens)`
    `static Set<String>` | `hopByHopConnectionSpecific(MessageHeaders headers)`
    `static boolean` | `isHopByHop(String headerName)`
    `static Iterator<HeaderElement>` | `iterate(MessageHeaders headers, String name)`
    `static Iterator<String>` | `iterateTokens(MessageHeaders headers, String name)`
    `static HeaderElement[]` | `parse(Header header)` Deprecated. Use `parseElements(Header, Consumer)`
    `static void` | `parseElements(CharSequence buffer, ParserCursor cursor, Consumer<HeaderElement> consumer)`
    `static List<HeaderElement>` | `parseElements(Header header)`
    `static void` | `parseElements(Header header, Consumer<HeaderElement> consumer)`
    `static void` | `parseElements(MessageHeaders headers, String headerName, Consumer<HeaderElement> consumer)`
    `static void` | `parseParameters(CharSequence src, ParserCursor cursor, Consumer<NameValuePair> consumer)`
    `static Set<String>` | `parseTokens(CharSequence src, ParserCursor cursor)`
    `static void` | `parseTokens(CharSequence src, ParserCursor cursor, Consumer<String> consumer)`
    `static Set<String>` | `parseTokens(Header header)`
    `static void` | `parseTokens(Header header, Consumer<String> consumer)`
    `static void` | `parseTokens(MessageHeaders headers, String headerName, Consumer<String> consumer)`

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

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

- - ### Method Detail

    - #### formatTokens

          public static void formatTokens(CharArrayBuffer dst,
                                          List<String> tokens)

      Since:
        5.3

    - #### formatTokens

          public static void formatTokens(CharArrayBuffer dst,
                                          String... tokens)

    - #### formatTokens

          public static void formatTokens(CharArrayBuffer dst,
                                          Set<String> tokens)

    - #### format

          @Deprecated
          public static Header format(String name,
                                                  Set<String> tokens)

      Deprecated. Use `header(String, Set)`

    - #### headerOfTokens

          public static Header headerOfTokens(String name,
                                              List<String> tokens)

      Since:
        5.3

    - #### header

          public static Header header(String name,
                                      Set<String> tokens)

      Since:
        5.3

    - #### header

          public static Header header(String name,
                                      String... tokens)

      Since:
        5.3

    - #### format

          @Deprecated
          public static Header format(String name,
                                                  String... tokens)

      Deprecated. use `header(String, String...)`

    - #### parseTokens

          public static void parseTokens(CharSequence src,
                                         ParserCursor cursor,
                                         Consumer<String> consumer)

      Since:
        5.3

    - #### parseTokens

          public static void parseTokens(Header header,
                                         Consumer<String> consumer)

      Since:
        5.3

    - #### parseTokens

          public static void parseTokens(MessageHeaders headers,
                                         String headerName,
                                         Consumer<String> consumer)

      Since:
        5.3

    - #### parseTokens

          public static Set<String> parseTokens(CharSequence src,
                                                ParserCursor cursor)

    - #### parseTokens

          public static Set<String> parseTokens(Header header)

    - #### iterateTokens

          public static Iterator<String> iterateTokens(MessageHeaders headers,
                                                       String name)

      Since:
        5.3

    - #### formatElements

          public static void formatElements(CharArrayBuffer dst,
                                            List<HeaderElement> elements)

      Since:
        5.3

    - #### formatElements

          public static void formatElements(CharArrayBuffer dst,
                                            HeaderElement... elements)

      Since:
        5.3

    - #### headerOfElements

          public static Header headerOfElements(String name,
                                                List<HeaderElement> elements)

      Since:
        5.3

    - #### header

          public static Header header(String name,
                                      HeaderElement... elements)

      Since:
        5.3

    - #### parseElements

          public static void parseElements(CharSequence buffer,
                                           ParserCursor cursor,
                                           Consumer<HeaderElement> consumer)

      Since:
        5.3

    - #### parseElements

          public static void parseElements(Header header,
                                           Consumer<HeaderElement> consumer)

      Since:
        5.3

    - #### parseElements

          public static void parseElements(MessageHeaders headers,
                                           String headerName,
                                           Consumer<HeaderElement> consumer)

      Since:
        5.3

    - #### parse

          @Deprecated
          public static HeaderElement[] parse(Header header)

      Deprecated. Use `parseElements(Header, Consumer)`

    - #### parseElements

          public static List<HeaderElement> parseElements(Header header)

      Since:
        5.3

    - #### iterate

          public static Iterator<HeaderElement> iterate(MessageHeaders headers,
                                                        String name)

    - #### formatParameters

          public static void formatParameters(CharArrayBuffer dst,
                                              List<NameValuePair> params)

      Since:
        5.3

    - #### formatParameters

          public static void formatParameters(CharArrayBuffer dst,
                                              NameValuePair... params)

      Since:
        5.3

    - #### parseParameters

          public static void parseParameters(CharSequence src,
                                             ParserCursor cursor,
                                             Consumer<NameValuePair> consumer)

      Since:
        5.3

    - #### addContentTypeHeader

          public static void addContentTypeHeader(HttpMessage message,
                                                  EntityDetails entity)

    - #### addContentEncodingHeader

          public static void addContentEncodingHeader(HttpMessage message,
                                                      EntityDetails entity)

    - #### addTrailerHeader

          public static void addTrailerHeader(HttpMessage message,
                                              EntityDetails entity)

    - #### canResponseHaveBody

          public static boolean canResponseHaveBody(String method,
                                                    HttpResponse response)

      Since:
        5.0

    - #### isHopByHop

          public static boolean isHopByHop(String headerName)

      Since:
        5.3

    - #### hopByHopConnectionSpecific

          public static Set<String> hopByHopConnectionSpecific(MessageHeaders headers)

      Since:
        5.3

Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.