hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jack van Ooststroom <Jack.vanOoststr...@ICEsoft.com>
Subject How to use HPACK with HttpClient 5
Date Wed, 22 Aug 2018 14:57:23 GMT
Hello,

We started using HttpClient 5 in order for us to communicate with 
Apple's APNs service which requires the usage of HTTP/2. However, we are 
currently running into an issue with the "apns-collapse-id" header. 
According to the specification 
(https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html):

    /"APNs requires the use of HPACK (header compression for HTTP/2),
    which prevents repeated header keys and values. APNs maintains a
    small dynamic table for HPACK. To help avoid filling up the APNs
    HPACK table and necessitating the discarding of table data, encode
    headers in the following way—especially when sending a large number
    of streams:/

      * /The :path value should be encoded as a literal header field
        without indexing/
      * /The authorization request header, if present, should be encoded
        as a literal header field without indexing/
      * /The appropriate encoding to employ for the apns-id,
        apns-expiration, and apns-collapse-id request headers differs
        depending on whether it is part of the initial or a subsequent
        POST operation, as follows:/
          o /The first time you send these headers, encode them with
            incremental indexing to allow the header names to be added
            to the dynamic table/
          o /Subsequent times you send these headers, encode them as
            literal header fields without indexing/

    /Encode all other headers as literal header fields with incremental
    indexing. For specifics on header encoding, see
    tools.ietf.org/html/rfc7541#section-6.2.1 and
    tools.ietf.org/html/rfc7541#section-6.2.2."/

When setting headers on a SimpleHttpRequest, how can we differentiate 
between /"... //encode them with incremental indexing..."/ and /"... 
//encode them as literal header fields without indexing"/?

Thanks in advance.

Regards,
Jack...
//


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message