private void sendSocketRequest() throws IOException { if (connection == null) { connect(); } if (transport != null) { throw new IllegalStateException(); } transport = (Transport) connection.newTransport(this); if (hasRequestBody() && requestBodyOut == null) { // Create a request body if we don't have one already. We'll already // have one if we're retrying a failed POST. requestBodyOut = transport.createRequestBody(); } }