Prepare the Request object for a new request.

@param httpBuffer the raw connection stream
502908
protected void initRequest()
  {
    _hostHeader = null;
    _xForwardedHostHeader = null;
    _expect100Continue = false;

    _cookies.clear();

    _contentLengthIn = -1;

    _hasReadStream = false;

    _readEncoding = null;

    //_request = request;
    //_requestFacade = getHttp().createFacade(this);
    
    _startTime = -1;
    _expireTime = -1;
    
    _isUpgrade = false;
    
    _statusCode = 200;
    _statusMessage = "OK";

    _headerKeysOut.clear();
    _headerValuesOut.clear();
    
    _contentTypeOut = null;
    _contentEncodingOut = null;
    _contentLengthOut = -1;

    _footerKeys.clear();
    _footerValues.clear();

    out().start();

    _isHeaderWritten = false;

    _isClosed = false;
    //_serverHeader = http().serverHeader();
    
    _isKeepalive = true;
  }
633546
protected void postProcessHttpRequest(HttpUriRequest httpRequest) {
		HttpParams params = httpRequest.getParams();
		HttpProtocolParams.setUseExpectContinue(params, false);
	}
194458
public RequestParameterBuilder reset() {
        buffer = new StringBuilder(originalUrl);
        jsonConverter.setType(null);
        added = false;

        return this;
    }
343435
public ParallelTaskBuilder prepareHttpPut(String url) {
        reinitIfClosed();
        ParallelTaskBuilder cb = new ParallelTaskBuilder();
        cb.getHttpMeta().setHttpMethod(HttpMethod.PUT);
        cb.getHttpMeta().setRequestUrlPostfix(url);
        return cb;

    }
686024
@Override
  public void initialize(HttpRequest httpRequest) throws IOException {
    // Do not throw if execute fails, since Axis will handle unmarshalling the
    // fault.
    httpRequest.setThrowExceptionOnExecuteError(false);

    // For consistency with the default Axis HTTPSender and CommonsHTTPSender, do not
    // follow redirects.
    httpRequest.setFollowRedirects(false);

    // Retry should be handled by the client.
    httpRequest.setNumberOfRetries(0);
  }
1234782
protected void prepareRequest(List<BoxAPIRequest> requests) {
        JsonObject body = new JsonObject();
        JsonArray requestsJSONArray = new JsonArray();
        for (BoxAPIRequest request: requests) {
            JsonObject batchRequest = new JsonObject();
            batchRequest.add("method", request.getMethod());
            batchRequest.add("relative_url", request.getUrl().toString().substring(this.api.getBaseURL().length() - 1));
            //If the actual request has a JSON body then add it to vatch request
            if (request instanceof BoxJSONRequest) {
                BoxJSONRequest jsonRequest = (BoxJSONRequest) request;
                batchRequest.add("body", jsonRequest.getBodyAsJsonValue());
            }
            //Add any headers that are in the request, except Authorization
            if (request.getHeaders() != null) {
                JsonObject batchRequestHeaders = new JsonObject();
                for (RequestHeader header: request.getHeaders()) {
                    if (header.getKey() != null && !header.getKey().isEmpty()
                        && !HttpHeaders.AUTHORIZATION.equals(header.getKey())) {
                        batchRequestHeaders.add(header.getKey(), header.getValue());
                    }
                }
                batchRequest.add("headers", batchRequestHeaders);
            }

            //Add the request to array
            requestsJSONArray.add(batchRequest);
        }
        //Add the requests array to body
        body.add("requests", requestsJSONArray);
        super.setBody(body);
    }
170463
public void __setBuffer(StringBuilder buffer) {
        if (null != __caller) ((TextBuilder) __caller).__setBuffer(buffer);
        else __buffer = buffer;
    }
1263656
private void setBufferSizes(HttpConfiguration buffers) {
        if (requestHeaderSize > 0) {
            LOGGER.info("Request header size set to {} for {}", requestHeaderSize, buffers.getClass().getCanonicalName());
            buffers.setRequestHeaderSize(requestHeaderSize);
        }

        if (responseBufferSize > 0) {
            LOGGER.info("Response buffer size set to {} for {}", responseBufferSize, buffers.getClass().getCanonicalName());
            buffers.setOutputBufferSize(responseBufferSize);
        }
        if (responseHeaderSize > 0) {
            LOGGER.info("Response header size set to {} for {}", responseHeaderSize, buffers.getClass().getCanonicalName());
            buffers.setResponseHeaderSize(responseHeaderSize);
        }
    }
1341731
public void setRequestedBytes(int newRequestedBytes)
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setRequestedBytes", newRequestedBytes);
      requestedBytes = newRequestedBytes;
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setRequestedBytes");
   }
373315
@Override
	public void prepareConditionalGet(final HttpUriRequest newRequest) {
		transferFirstHeader("ETag", "If-None-Match", this.response, newRequest);
		transferFirstHeader("Last-Modified", "If-Modified-Since", this.response, newRequest);
	}
107838
public final ClientHttpRequest createRequest(URI uri, HttpMethod httpMethod) throws IOException {
		return createRequest(uri, httpMethod, requestFactory);
	}
1324363
public synchronized void create( HttpServletRequest request,
                                     HttpServletResponse response,
                                     ServletContext servletContext )
    {
        PerRequestState prevState = setPerRequestState( new PerRequestState( request, response, null ) );

        try
        {
            try
            {
                // we start the context on the bean so user control can run against Controls in the onCreate() method
                super.create( request, response, servletContext );
            }
            catch ( Throwable th )
            {
                try
                {
                    _log.info( "Handling exception in onCreate(), FlowController " + this, th );
                    reinitialize(request, response, servletContext);
                    ActionForward fwd = handleException( th, null, null, request, response );
                    if ( fwd == null ) fwd = NULL_ACTION_FORWARD;
                    request.setAttribute( ONCREATE_EXCEPTION_FORWARD, fwd );
                }
                catch ( Exception e )
                {
                    _log.error( "Exception thrown while handling exception in onCreate(): " + e.getMessage(), th );
                }
            }
        }
        finally
        {
            if(prevState != null)
                setPerRequestState( prevState );

            PageFlowControlContainer pfcc = PageFlowControlContainerFactory.getControlContainer(request,getServletContext());
            pfcc.endContextOnPageFlow(this);
        }

        PageFlowEventReporter er = AdapterManager.getServletContainerAdapter( servletContext ).getEventReporter();
        RequestContext requestContext = new RequestContext( request, response );
        er.flowControllerCreated( requestContext, this );
    }
1245330
public void addRequestHttpHeader(Map<String, String> httpHeader) {

        if (this.requestHttpHeaders == null)
            this.requestHttpHeaders = new HashMap<>();

        this.requestHttpHeaders.putAll(httpHeader);
    }
683354
private ByteBuf writeRequest(ByteBuf buffer, Object request, ThreadContext context) {
    context.serializer().writeObject(request, OUTPUT.get().setByteBuf(buffer));
    if (request instanceof ReferenceCounted) {
      ((ReferenceCounted) request).release();
    }
    return buffer;
  }
446947
public void setBuffer(final String buffer) {
        initRandomBuffer();
        byteBufferAry = Arrays.copyOf(buffer.getBytes(), MAX_PACKETBUFFER_LENGTH);
    }
476105
public HttpWebServiceMessageSenderBuilder requestFactory(
			Supplier<ClientHttpRequestFactory> requestFactorySupplier) {
		Assert.notNull(requestFactorySupplier,
				"RequestFactory Supplier must not be null");
		this.requestFactorySupplier = requestFactorySupplier;
		return this;
	}
730730
private void initStream() throws IOException {

        if (m_out == null) {
            if (!m_writeOnlyToBuffer) {
                // we can use the parents output stream
                if (m_cachingRequired || (m_controller.getResponseStackSize() > 1)) {
                    // we are allowed to cache our results (probably to construct a new cache entry)
                    m_out = new CmsFlexResponse.CmsServletOutputStream(m_res.getOutputStream());
                } else {
                    // we are not allowed to cache so we just use the parents output stream
                    m_out = (CmsFlexResponse.CmsServletOutputStream)m_res.getOutputStream();
                }
            } else {
                // construct a "buffer only" output stream
                m_out = new CmsFlexResponse.CmsServletOutputStream();
            }
        }
        if (m_writer == null) {
            // create a PrintWriter that uses the encoding required for the request context
            m_writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(m_out, m_encoding)), false);
        }
    }