@Override protected Handshake handshake() { if (delegate.httpEngine == null) { throw new IllegalStateException("Connection has not yet been established"); } // If there's a response, get the handshake from there so that caching // works. Otherwise get the handshake from the connection because we might // have not connected yet. return delegate.httpEngine.hasResponse() ? delegate.httpEngine.getResponse().handshake() : delegate.handshake; }
@Override protected Handshake handshake() { if (delegate.httpEngine == null) { throw new IllegalStateException("Connection has not yet been established"); } // If there's a response, get the handshake from there so that caching // works. Otherwise get the handshake from the connection because we might // have not connected yet. return delegate.httpEngine.hasResponse() ? delegate.httpEngine.getResponse().handshake() : delegate.handshake; }
@Override protected Handshake handshake() { if (delegate.httpEngine == null) { throw new IllegalStateException("Connection has not yet been established"); } // If there's a response, get the handshake from there so that caching // works. Otherwise get the handshake from the connection because we might // have not connected yet. return delegate.httpEngine.hasResponse() ? delegate.httpEngine.getResponse().handshake() : delegate.handshake; }
@Override public final OutputStream getOutputStream() throws IOException { connect(); BufferedSink sink = httpEngine.getBufferedRequestBody(); if (sink == null) { throw new ProtocolException("method does not support a request body: " + method); } else if (httpEngine.hasResponse()) { throw new ProtocolException("cannot write request body after response has been read"); } return sink.outputStream(); }
@Override public final OutputStream getOutputStream() throws IOException { connect(); BufferedSink sink = httpEngine.getBufferedRequestBody(); if (sink == null) { throw new ProtocolException("method does not support a request body: " + method); } else if (httpEngine.hasResponse()) { throw new ProtocolException("cannot write request body after response has been read"); } return sink.outputStream(); }
@Override public final OutputStream getOutputStream() throws IOException { connect(); BufferedSink sink = httpEngine.getBufferedRequestBody(); if (sink == null) { throw new ProtocolException("method does not support a request body: " + method); } else if (httpEngine.hasResponse()) { throw new ProtocolException("cannot write request body after response has been read"); } return sink.outputStream(); }
initHttpEngine(); if (httpEngine.hasResponse()) { return httpEngine;
initHttpEngine(); if (httpEngine.hasResponse()) { return httpEngine;
initHttpEngine(); if (httpEngine.hasResponse()) { return httpEngine;