/** * @param request the HTTP request without a body. The body must be written via the engine's * request body stream. * @param callerWritesRequestBody true for the {@code HttpURLConnection}-style interaction * model where control flow is returned to the calling application to write the request body * before the response body is readable. */ public HttpEngine(OkHttpClient client, Request request, boolean bufferRequestBody, boolean callerWritesRequestBody, boolean forWebSocket, StreamAllocation streamAllocation, RetryableSink requestBodyOut, Response priorResponse) { this.client = client; this.userRequest = request; this.bufferRequestBody = bufferRequestBody; this.callerWritesRequestBody = callerWritesRequestBody; this.forWebSocket = forWebSocket; this.streamAllocation = streamAllocation != null ? streamAllocation : new StreamAllocation(client.getConnectionPool(), createAddress(client, request)); this.requestBodyOut = requestBodyOut; this.priorResponse = priorResponse; }
/** * @param request the HTTP request without a body. The body must be written via the engine's * request body stream. * @param callerWritesRequestBody true for the {@code HttpURLConnection}-style interaction model * where control flow is returned to the calling application to write the request body before the * response body is readable. */ public HttpEngine(OkHttpClient client, Request request, boolean bufferRequestBody, boolean callerWritesRequestBody, boolean forWebSocket, StreamAllocation streamAllocation, RetryableSink requestBodyOut, Response priorResponse) { this.client = client; this.userRequest = request; this.bufferRequestBody = bufferRequestBody; this.callerWritesRequestBody = callerWritesRequestBody; this.forWebSocket = forWebSocket; this.streamAllocation = streamAllocation != null ? streamAllocation : new StreamAllocation(client.connectionPool(), createAddress(client, request)); this.requestBodyOut = requestBodyOut; this.priorResponse = priorResponse; }
/** * @param request the HTTP request without a body. The body must be written via the engine's * request body stream. * @param callerWritesRequestBody true for the {@code HttpURLConnection}-style interaction * model where control flow is returned to the calling application to write the request body * before the response body is readable. */ public HttpEngine(OkHttpClient client, Request request, boolean bufferRequestBody, boolean callerWritesRequestBody, boolean forWebSocket, StreamAllocation streamAllocation, RetryableSink requestBodyOut, Response priorResponse) { this.client = client; this.userRequest = request; this.bufferRequestBody = bufferRequestBody; this.callerWritesRequestBody = callerWritesRequestBody; this.forWebSocket = forWebSocket; this.streamAllocation = streamAllocation != null ? streamAllocation : new StreamAllocation(client.getConnectionPool(), createAddress(client, request)); this.requestBodyOut = requestBodyOut; this.priorResponse = priorResponse; }