@Override public boolean getDoOutput() { return delegate.getDoOutput(); }
@Override public boolean getDoOutput() { return delegate.getDoOutput(); }
@Override protected ClientHttpResponse executeInternal(HttpHeaders headers, byte[] bufferedOutput) throws IOException { addHeaders(this.connection, headers); // JDK <1.8 doesn't support getOutputStream with HTTP DELETE if (getMethod() == HttpMethod.DELETE && bufferedOutput.length == 0) { this.connection.setDoOutput(false); } if (this.connection.getDoOutput() && this.outputStreaming) { this.connection.setFixedLengthStreamingMode(bufferedOutput.length); } this.connection.connect(); if (this.connection.getDoOutput()) { FileCopyUtils.copy(bufferedOutput, this.connection.getOutputStream()); } else { // Immediately trigger the request in a no-output scenario as well this.connection.getResponseCode(); } return new SimpleClientHttpResponse(this.connection); }
@Override public ClientHttpResponse call() throws Exception { SimpleBufferingClientHttpRequest.addHeaders(connection, headers); // JDK <1.8 doesn't support getOutputStream with HTTP DELETE if (getMethod() == HttpMethod.DELETE && bufferedOutput.length == 0) { connection.setDoOutput(false); } if (connection.getDoOutput() && outputStreaming) { connection.setFixedLengthStreamingMode(bufferedOutput.length); } connection.connect(); if (connection.getDoOutput()) { FileCopyUtils.copy(bufferedOutput, connection.getOutputStream()); } else { // Immediately trigger the request in a no-output scenario as well connection.getResponseCode(); } return new SimpleClientHttpResponse(connection); } });
@Override public ClientHttpResponse call() throws Exception { SimpleBufferingClientHttpRequest.addHeaders(connection, headers); // JDK <1.8 doesn't support getOutputStream with HTTP DELETE if (getMethod() == HttpMethod.DELETE && bufferedOutput.length == 0) { connection.setDoOutput(false); } if (connection.getDoOutput() && outputStreaming) { connection.setFixedLengthStreamingMode(bufferedOutput.length); } connection.connect(); if (connection.getDoOutput()) { FileCopyUtils.copy(bufferedOutput, connection.getOutputStream()); } else { // Immediately trigger the request in a no-output scenario as well connection.getResponseCode(); } return new SimpleClientHttpResponse(connection); } });
@Override protected ClientHttpResponse executeInternal(HttpHeaders headers, byte[] bufferedOutput) throws IOException { addHeaders(this.connection, headers); // JDK <1.8 doesn't support getOutputStream with HTTP DELETE if (getMethod() == HttpMethod.DELETE && bufferedOutput.length == 0) { this.connection.setDoOutput(false); } if (this.connection.getDoOutput() && this.outputStreaming) { this.connection.setFixedLengthStreamingMode(bufferedOutput.length); } this.connection.connect(); if (this.connection.getDoOutput()) { FileCopyUtils.copy(bufferedOutput, this.connection.getOutputStream()); } else { // Immediately trigger the request in a no-output scenario as well this.connection.getResponseCode(); } return new SimpleClientHttpResponse(this.connection); }
private void testRequestBodyAllowed(URL uri, String httpMethod, boolean allowed) throws IOException { HttpURLConnection connection = new TestHttpURLConnection(uri); ((SimpleClientHttpRequestFactory) this.factory).prepareConnection(connection, httpMethod); assertEquals(allowed, connection.getDoOutput()); }
try { conn.connect(); if (conn.getDoOutput()) writePost(req, conn.getOutputStream(), mimeBoundary);
@Override public boolean getDoOutput() { return delegate.getDoOutput(); }
@Override public boolean getDoOutput() { return delegate.getDoOutput(); }
@Override public boolean getDoOutput() { return delegate.getDoOutput(); }
@Override public boolean getDoOutput() { return super.getDoOutput(); }
@Override public boolean getDoOutput () { return this.connection.getDoOutput(); }
@Override public boolean getDoOutput() { return delegate.getDoOutput(); }
@Override public boolean getDoOutput () { return this.connection.getDoOutput(); }
@Override public boolean getDoOutput() { return delegate.getDoOutput(); }
@Override public boolean getDoOutput() { return delegate.getDoOutput(); }
@Override public boolean getDoOutput() { return delegate.getDoOutput(); }
@Override public boolean getDoOutput() { return delegate.getDoOutput(); }
@Override public void close() { if (conn == null) return; // close input and output streams to allow for connection re-use. if (conn.getDoOutput()) { try { IOUtil.closeQuietly(conn.getOutputStream()); } catch (IOException ex) { // ignore } } // should not need to disconnect after closing the relevant streams conn = null; }