Code example for HttpRequest

Methods: addHeadercontainsHeadergetRequestLine

    public void process(final HttpRequest request, final HttpContext context)
            throws HttpException, IOException { 
        if (request == null) {
            throw new IllegalArgumentException("HTTP request may not be null");
        String method = request.getRequestLine().getMethod();
        if (method.equalsIgnoreCase("CONNECT")) {
        if (!request.containsHeader(HTTP.CONN_DIRECTIVE)) {
            // Default policy is to keep connection alive 
            // whenever possible 
            request.addHeader(HTTP.CONN_DIRECTIVE, HTTP.CONN_KEEP_ALIVE);
Connect your IDE to all the code out there  Get Codota for Java