BufferedRequestBody(long expectedContentLength) { initOutputStream(buffer, expectedContentLength); }
/** * Now that we've buffered the entire request body, update the request headers and the body * itself. This happens late to enable HttpURLConnection users to complete the socket connection * before sending request body bytes. */ @Override public Request prepareToSendRequest(Request request) throws IOException { if (request.header("Content-Length") != null) return request; outputStream().close(); contentLength = buffer.size(); return request.newBuilder() .removeHeader("Transfer-Encoding") .header("Content-Length", Long.toString(buffer.size())) .build(); }
: new BufferedRequestBody(contentLength); requestBody.timeout().timeout(client.writeTimeoutMillis(), TimeUnit.MILLISECONDS);
: new BufferedRequestBody(contentLength); requestBody.timeout().timeout(client.writeTimeoutMillis(), TimeUnit.MILLISECONDS);
/** * Now that we've buffered the entire request body, update the request headers and the body * itself. This happens late to enable HttpURLConnection users to complete the socket connection * before sending request body bytes. */ @Override public Request prepareToSendRequest(Request request) throws IOException { if (request.header("Content-Length") != null) return request; outputStream().close(); contentLength = buffer.size(); return request.newBuilder() .removeHeader("Transfer-Encoding") .header("Content-Length", Long.toString(buffer.size())) .build(); }
BufferedRequestBody(long expectedContentLength) { initOutputStream(buffer, expectedContentLength); }
: new BufferedRequestBody(contentLength); requestBody.timeout().timeout(client.writeTimeoutMillis(), TimeUnit.MILLISECONDS);
/** * Now that we've buffered the entire request body, update the request headers and the body * itself. This happens late to enable HttpURLConnection users to complete the socket connection * before sending request body bytes. */ @Override public Request prepareToSendRequest(Request request) throws IOException { if (request.header("Content-Length") != null) return request; outputStream().close(); contentLength = buffer.size(); return request.newBuilder() .removeHeader("Transfer-Encoding") .header("Content-Length", Long.toString(buffer.size())) .build(); }
BufferedRequestBody(long expectedContentLength) { initOutputStream(buffer, expectedContentLength); }
: new BufferedRequestBody(contentLength); requestBody.timeout().timeout(client.writeTimeoutMillis(), TimeUnit.MILLISECONDS);
/** * Now that we've buffered the entire request body, update the request headers and the body * itself. This happens late to enable HttpURLConnection users to complete the socket connection * before sending request body bytes. */ @Override public Request prepareToSendRequest(Request request) throws IOException { if (request.header("Content-Length") != null) return request; outputStream().close(); contentLength = buffer.size(); return request.newBuilder() .removeHeader("Transfer-Encoding") .header("Content-Length", Long.toString(buffer.size())) .build(); }
BufferedRequestBody(long expectedContentLength) { initOutputStream(buffer, expectedContentLength); }