From httpclient-users-return-14303-archive-asf-public=cust-asf.ponee.io@hc.apache.org Wed Aug 22 16:56:59 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 9508A180662 for ; Wed, 22 Aug 2018 16:56:58 +0200 (CEST) Received: (qmail 82559 invoked by uid 500); 22 Aug 2018 14:56:57 -0000 Mailing-List: contact httpclient-users-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-users@hc.apache.org Received: (qmail 82547 invoked by uid 99); 22 Aug 2018 14:56:56 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Aug 2018 14:56:56 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 6B662C5F3E for ; Wed, 22 Aug 2018 14:56:56 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.398 X-Spam-Level: ** X-Spam-Status: No, score=2.398 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, KAM_NUMSUBJECT=0.5, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=icesoft.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id S1eSXyb0Ujl7 for ; Wed, 22 Aug 2018 14:56:54 +0000 (UTC) Received: from mail.icesoft.com (mail.icesoft.com [54.245.114.191]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 2226A5F2AD for ; Wed, 22 Aug 2018 14:56:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ICEsoft.com; s=mail; h=from:subject:date:message-id:to:mime-version:content-type; bh=YUS6OxsgNqcjUJAnoqkks4jxhUlqFv1K/8w3ca6gZ8w=; b=mswu4CfBoIVkaiKBuuh9JR3FkHZufyiaWIvFdlop8J95EL71LsgbVVOIXACnqHV7LIZ3hfRGvWjuU pNvEuhzqN0d4hXB3EKsYeM3x7IQIX6Pw7AGpBvzTdMcS2ZKOM8K2nLPCLIOAyz/AHVEvQcO08T0LgE cmw/zkCRcVe5fRnK4VqJP+NUe7Mqh8EH2ZovlvDi1rJiudB5OlO6IZSB+a01m+/UGeq6iH1DOnIvJt VF1vaaWry5f4x4N/9XIW1RaVeso9hwCRsODsijwX7H81mPCmG4d+327HwADqsgoKjFhm9ztj8iwsmA atvhkodx9z1d3FV6b0IuqBxzD8b3COw== X-Footer: aWNlc29mdC5jb20= Received: from Jeroens-MacBook-Pro.local ([62.194.140.235]) (authenticated user jvanooststroom@icesoft.com) by mail.icesoft.com (Kerio Connect 8.5.3) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits)) for httpclient-users@hc.apache.org; Wed, 22 Aug 2018 10:56:50 -0400 To: httpclient-users@hc.apache.org From: Jack van Ooststroom Subject: How to use HPACK with HttpClient 5 Message-ID: <8caf1dea-dc61-e713-569b-edca07d62160@ICEsoft.com> Date: Wed, 22 Aug 2018 16:57:23 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------AA465D9B9559A8F67DDCF6D9" Content-Language: en-US --------------AA465D9B9559A8F67DDCF6D9 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit 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... // --------------AA465D9B9559A8F67DDCF6D9--