-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 André,
On 4/24/15 10:17 AM, André Warnier wrote: > No, but I tried. But everything I found seems to say that such > trailers are really rarely used, and that's probably why you are > not getting any echo. > > I believe that initially you mentioned that you had found a > perfectly good use case, but you never explained what it was... I'm happy to explain. It's actually kind of the poster-child for trailer s. I have an XML message that I'd like to send to a server, and I'd like to sign it with a cryptographic signature (an HMAC, actually). I'd like to be able to support LARGE messages, even though for the most part, they are currently small. In order to do this today, we read the *whole* message from wherever it came from, HMAC the whole thing, then contact the server and send the HMAC as a header, then dump the *whole* message into the request entity. These days, most messages are at more a few kb or whatever, so buffering them in memory isn't a big deal. Also, the client isn't on a server, so it's not like we are going to make much in the way of resource issues, here. Anyhow, I'd love to be able to support a more streaming-friendly interface so we could handle huge messages. We would simply stream the XML as the request entity, and when it was done, we'd add the trailer that says "oh, btw, the HMAC was [x]". I hope that clears things up. Thanks, - -chris > On 4/18/15 12:19 PM, Christopher Schultz wrote: >>>> All, >>>> >>>> I've got a perfect use-case for HTTP trailers but it doesn't >>>> seem like any existing client (e.g. HttpURLConnection, >>>> HttpClient) has support for them on the /sending/ side. >>>> >>>> HttpURLConnection doesn't have a way (that I can see) to >>>> fetch trailing headers, but it may just be that you have to >>>> consume the response and then check the headers (similar to >>>> what you'd do in a Servlet when the client actually sends >>>> trailing headers to the server). >>>> >>>> HttpClient allows you to get the trailing headers from a >>>> response in a very awkward way by reading them from the >>>> ChunkedInputStream which is buried a few levels deep, >>>> evidently. >>>> >>>> But neither seem to have a way to actually *send* headers to >>>> the server. >>>> >>>> Has anyone ever actually done this from a Java-based client? >>>> I'm currently using my own wrapper around HttpURLConnection >>>> (because HttpClient seemed to heavy for my purposes) and >>>> it's been working great for a few years. I'd like to support >>>> a streaming mode plus trailer headers with it, and I'd prefer >>>> not to dump HttpURLConnection and replace it with low-level >>>> socket work because them I'll have to do a whole bunch of >>>> work to reproduce what HttpURLConnection is already providing >>>> (e.g. TLS, auto-redirects, etc.). >>>> >>>> Any ideas from the community? >>>> >>>> Thanks, -chris >>>> >>>> ------------------------------------------------------------------- - -- >>>> >>>> > >>>> >>>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org >>>> For additional commands, e-mail: >>>> users-h...@tomcat.apache.org >>>> >> >> --------------------------------------------------------------------- >> >> >> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org >> For additional commands, e-mail: users-h...@tomcat.apache.org >> >> > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: GPGTools - http://gpgtools.org iQIcBAEBCAAGBQJVOlScAAoJEBzwKT+lPKRYKO4P/2vFLX7eP9BmCc/TBtw/6wV2 06u4ekIeIR1gkBaPJq5dp5y8dRfqeysIEzhgXKFTiLuqF5SLNdRXaCs5twQRiZrw JDh6d8Zy7Sec2HOXDAfNzzBq2AROKDz/PPWJYXbJLmwmGQTqIh3J72+HKsAVwesi BB8QxI0o04iDmmkcSzjkRcztKriVfAJtksAjyJcB4bw7xlcJdEhOXbtbO6wJ6Yd0 m0eQQbU8mAJiqM9VkHPSUEnmR3P5s1vxIJ5e4tZYEO8CADDhZkBCwTyQKhZctteE uDwq8XoTAmTuqXyAfUBqmGilpjNU9EF9I/K0ZnLydoAsVmD5IrGMNutx0ya6g4cs W5nc9O2NE96sisdicAdZEj9t7CbRc9Vwb44j/drMiAZRBYzcplTmeII1+5UgWGJp apa1DwZOPOcnLkW3GKkHRv/Wv02r9qmVAmFRVLNIsXp4cKgvTm8pC3vJhmpiEaya hUzpoJbDL1JFkeUYqMXlfJ7qHkA23tUsiez9Ws1wtP4ux5XFesd5OficoyY/ZCSd zhf9s204JfFqND0IGPnUHOqqK/rAe1D1GE/1me95iN2h9/vB8TvbvfehiP5JIR7K Y7/61OTaeA++vutdXDpPTg6VVEG0mker+TcQFbHf2c9Xkp+K5Gj55loHflsHf1bD e0hwdkEmw28JkbSp/QmV =lVZp -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org