Re: [OT] Sending HTTP Trailers from a client (not servlet)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 All, Bump. Anyone? - -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 -BEGIN PGP SIGNATURE- Version: GnuPG v2 Comment: GPGTools - http://gpgtools.org iQIcBAEBCAAGBQJVOk4RAAoJEBzwKT+lPKRYLQUP/RtRPIVVhWQaFCDXV3PGwGqS 6Mm1mWndE+Ma1QpmQyHJtEDOI1r2dli/eUVclhlNtQyw4oc3vJssgmi0rfCmsJKJ c0U5eFA+odNnJKGh06y3ItCR/KVYhwNzbMS7LGw537AAiFb4Ls7ZgdmJeMndL7zE 7ovalopWzqmATijOKZoWFIe3NEDvudGN+dYefOgBzQc5fTYyu1tsDJGUEF8BEULA tW9aueeQztSJOG3+PgrdVOP3bGBYARorzcJgv5xF7wUEad2vbLcsrkphFZGVgsmH NKOf7WVEqEWkAGap43Cb57j324nAcR/W1OqWMoUYlIhuR+r8YA9VM7Nm84xqsV2j Fp5qQEzagkVAdGXibBBzEfa2neb1/HGtEOfNyH8O+zgC4+yJZH88lwY6FpnrUo5B A3J0Pk0Gq2BW/CjjKUsfX97215BmZkM/I6BF7pZSshMdC4BHwNidtvh8X/acVc7+ 8AZMTV+RyQUAZR4SagDUvaaATKBhC4K/SVvGOH9wAW+0HwDwE1luj4S9dkch0dzA 50CoJWaZLm/9Hk68xazvyxcHFLsu5cUf7CC9MvHZR8022kFX8fLHf2YNxZVv+jUO UiXou9VKYIlPkhzDyHfl8HhWFRR+cO1D/nTzaDk7iqSQNKXr0PXTsvbUNCDjX8so Tfkc7x6zoIuRGS0r3rAM =BpMx -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [OT] Sending HTTP Trailers from a client (not servlet)
Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 All, Bump. Anyone? 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... - -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 -BEGIN PGP SIGNATURE- Version: GnuPG v2 Comment: GPGTools - http://gpgtools.org iQIcBAEBCAAGBQJVOk4RAAoJEBzwKT+lPKRYLQUP/RtRPIVVhWQaFCDXV3PGwGqS 6Mm1mWndE+Ma1QpmQyHJtEDOI1r2dli/eUVclhlNtQyw4oc3vJssgmi0rfCmsJKJ c0U5eFA+odNnJKGh06y3ItCR/KVYhwNzbMS7LGw537AAiFb4Ls7ZgdmJeMndL7zE 7ovalopWzqmATijOKZoWFIe3NEDvudGN+dYefOgBzQc5fTYyu1tsDJGUEF8BEULA tW9aueeQztSJOG3+PgrdVOP3bGBYARorzcJgv5xF7wUEad2vbLcsrkphFZGVgsmH NKOf7WVEqEWkAGap43Cb57j324nAcR/W1OqWMoUYlIhuR+r8YA9VM7Nm84xqsV2j Fp5qQEzagkVAdGXibBBzEfa2neb1/HGtEOfNyH8O+zgC4+yJZH88lwY6FpnrUo5B A3J0Pk0Gq2BW/CjjKUsfX97215BmZkM/I6BF7pZSshMdC4BHwNidtvh8X/acVc7+ 8AZMTV+RyQUAZR4SagDUvaaATKBhC4K/SVvGOH9wAW+0HwDwE1luj4S9dkch0dzA 50CoJWaZLm/9Hk68xazvyxcHFLsu5cUf7CC9MvHZR8022kFX8fLHf2YNxZVv+jUO UiXou9VKYIlPkhzDyHfl8HhWFRR+cO1D/nTzaDk7iqSQNKXr0PXTsvbUNCDjX8so Tfkc7x6zoIuRGS0r3rAM =BpMx -END PGP SIGNATURE- - 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
Re: [OT] Sending HTTP Trailers from a client (not servlet)
-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
[OT] Sending HTTP Trailers from a client (not servlet)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 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 -BEGIN PGP SIGNATURE- Version: GnuPG v2 Comment: GPGTools - http://gpgtools.org iQIcBAEBCAAGBQJVMoQlAAoJEBzwKT+lPKRYIJIP/RaTgeS/0IcrB6lw5eheBhpu 69IBNSi6E0doR+TmxjvsENlCKOpZcepZ5kqUfGTh704hJJMHXxDDoPUb0L02GZFG jFhZIAitZh2249e7msBw5zgI5+xcaPGYKPbAHIZepxXj/kj+OdybNdNrKvMNJRNY yDYQJYxn6HSxLvBqSd3Fka8phEJVlhn70xgtp/8H7EvNI1zohPxj6g3b7cfKmf2h w2oqWC4cOvqClA6/F8A8avGlU1LYrTKkLruWEVRqTsTYbMaHUBiLidgqKcLC1nOE JW+zzEWjox3EaY/7OraAUNnlN4xlko8lLBWn1YxPf8iv45avaA/sGyyIUaqzRNFh SIBUlEOL0ldG3yk7Odr7U5f9DAnRFgb2nDm2c/gzBPfxwYx/1CP73MFv+rWA+ASF 31BzqelbiIgnShiDY1Lq/FkXFlTfiaYrjqxNxE4YawyuCML34rPM+zcoh4nmKS43 5Wc5nxCJ9OX/JhN7aTxgkdBY19ad72C5aVoyojzYQm42gIhe6aBlZwpIFFmNeZhW k01JbwFpG6i/Z8K428MK/aI7O6yas6wWbQf6qtmyG2d2zh0u21oSXQ5top/AnfgA c+kzRUaBmECUN+Ax5rqsxahjON7aMV9JU0IWf6yI39OsMDhmljQ5+hSb4tsDFV5k h5np8G3cXN/rdmX4Dmb2 =69hw -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org