Here is what I have tried so far, but it just returns an empty string:

    private String serializeRequest(HttpRequest httpRequest) throws
IOException, HttpException {
        final ByteArrayOutputStream os = new ByteArrayOutputStream();
        VirtualOutputBuffer vob = new VirtualOutputBuffer(os, 1024,
httpRequest.getParams());
        LineFormatter lf = new BasicLineFormatter();
        HttpRequestWriter hrw = new HttpRequestWriter(vob, lf,
httpRequest.getParams());
        hrw.write(httpRequest);
        os.flush();
        return new String(os.toByteArray(), "UTF-8");
    }

    private static class VirtualOutputBuffer extends
AbstractSessionOutputBuffer {
        private VirtualOutputBuffer(OutputStream outputStream, int
buffersize, HttpParams params) {
            init(outputStream, buffersize, params);
        }
    }


On Sat, Aug 14, 2010 at 1:27 PM, Joshua Ball <[email protected]> wrote:

> Hi,
>
> How can I capture the output generated for a http get/post? (for debugging
> purposes)
>
> Normally I would just use wireshark, but the remote server only accepts
> SSL.
>
> Josh "Ua" Ball
>

Reply via email to