@Override protected ClientHttpResponse executeInternal(HttpHeaders headers) throws IOException { try { if (this.body != null) { this.body.close(); } else { SimpleBufferingClientHttpRequest.addHeaders(this.connection, headers); this.connection.connect(); // Immediately trigger the request in a no-output scenario as well this.connection.getResponseCode(); } } catch (IOException ex) { // ignore } return new SimpleClientHttpResponse(this.connection); }
@Override public ClientHttpResponse call() throws Exception { try { if (body != null) { body.close(); } else { SimpleBufferingClientHttpRequest.addHeaders(connection, headers); connection.connect(); // Immediately trigger the request in a no-output scenario as well connection.getResponseCode(); } } catch (IOException ex) { // ignore } return new SimpleClientHttpResponse(connection); } });
@Override protected ClientHttpResponse executeInternal(HttpHeaders headers) throws IOException { try { if (this.body != null) { this.body.close(); } else { SimpleBufferingClientHttpRequest.addHeaders(this.connection, headers); this.connection.connect(); // Immediately trigger the request in a no-output scenario as well this.connection.getResponseCode(); } } catch (IOException ex) { // ignore } return new SimpleClientHttpResponse(this.connection); }
@Override public ClientHttpResponse call() throws Exception { try { if (body != null) { body.close(); } else { SimpleBufferingClientHttpRequest.addHeaders(connection, headers); connection.connect(); // Immediately trigger the request in a no-output scenario as well connection.getResponseCode(); } } catch (IOException ex) { // ignore } 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); }
@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); }
@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) throws IOException { try { if (this.body != null) { this.body.close(); } else { writeHeaders(headers); this.connection.connect(); } } catch (IOException ex) { // ignore } return new SimpleClientHttpResponse(this.connection); }
@Override public ClientHttpResponse call() throws Exception { try { if (body != null) { body.close(); } else { SimpleBufferingClientHttpRequest.addHeaders(connection, headers); connection.connect(); // Immediately trigger the request in a no-output scenario as well connection.getResponseCode(); } } catch (IOException ex) { // ignore } return new SimpleClientHttpResponse(connection); } });
@Override protected ClientHttpResponse executeInternal(HttpHeaders headers) throws IOException { try { if (this.body != null) { this.body.close(); } else { SimpleBufferingClientHttpRequest.addHeaders(this.connection, headers); this.connection.connect(); // Immediately trigger the request in a no-output scenario as well this.connection.getResponseCode(); } } catch (IOException ex) { // ignore } return new SimpleClientHttpResponse(this.connection); }
@Override public ClientHttpResponse call() throws Exception { try { if (body != null) { body.close(); } else { SimpleBufferingClientHttpRequest.addHeaders(connection, headers); connection.connect(); // Immediately trigger the request in a no-output scenario as well connection.getResponseCode(); } } catch (IOException ex) { // ignore } return new SimpleClientHttpResponse(connection); } });
@Override protected ClientHttpResponse executeInternal(HttpHeaders headers) throws IOException { try { if (this.body != null) { this.body.close(); } else { SimpleBufferingClientHttpRequest.addHeaders(this.connection, headers); this.connection.connect(); // Immediately trigger the request in a no-output scenario as well this.connection.getResponseCode(); } } catch (IOException ex) { // ignore } return new SimpleClientHttpResponse(this.connection); }
@Override protected ClientHttpResponse executeInternal(HttpHeaders headers, byte[] bufferedOutput) throws IOException { for (Map.Entry<String, List<String>> entry : headers.entrySet()) { String headerName = entry.getKey(); for (String headerValue : entry.getValue()) { this.connection.addRequestProperty(headerName, headerValue); } } if (this.connection.getDoOutput()) { this.connection.setFixedLengthStreamingMode(bufferedOutput.length); } this.connection.connect(); if (this.connection.getDoOutput()) { FileCopyUtils.copy(bufferedOutput, this.connection.getOutputStream()); } 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 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 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); }