/** * Write reader to request body * <p/> * The given reader will be closed once sending completes * * @param input * @return this request * @throws HttpRequestException */ public HttpRequest send(final Reader input) throws HttpRequestException { try { openOutput(); } catch (IOException e) { throw new HttpRequestException(e); } final Writer writer = new OutputStreamWriter(output, output.encoder.charset()); return new FlushOperation<HttpRequest>(writer) { @Override protected HttpRequest run() throws IOException { return copy(input, writer); } }.call(); }
/** * Write reader to request body * <p> * The given reader will be closed once sending completes * * @param input * @return this request * @throws HttpRequestException */ public HttpRequest send(final Reader input) throws HttpRequestException { try { openOutput(); } catch (IOException e) { throw new HttpRequestException(e); } final Writer writer = new OutputStreamWriter(output, output.encoder.charset()); return new FlushOperation<HttpRequest>(writer) { @Override protected HttpRequest run() throws IOException { return copy(input, writer); } }.call(); }
/** * Write reader to request body * <p> * The given reader will be closed once sending completes * * @param input * @return this request * @throws HttpRequestException */ public HttpRequest send(final Reader input) throws HttpRequestException { try { openOutput(); } catch (IOException e) { throw new HttpRequestException(e); } final Writer writer = new OutputStreamWriter(output, output.encoder.charset()); return new FlushOperation<HttpRequest>(writer) { @Override protected HttpRequest run() throws IOException { return copy(input, writer); } }.call(); }
/** * Write reader to request body * <p> * The given reader will be closed once sending completes * * @param input * @return this request * @throws HttpRequestException */ public HttpRequest send(final Reader input) throws HttpRequestException { try { openOutput(); } catch (IOException e) { throw new HttpRequestException(e); } final Writer writer = new OutputStreamWriter(output, output.encoder.charset()); return new FlushOperation<HttpRequest>(writer) { @Override protected HttpRequest run() throws IOException { return copy(input, writer); } }.call(); }