lib/http/native_parser.rb
def parse_request_line(scanner)
      if (scanner.scan(RequestLineMatch))
        @method = scanner[1]
        @path = scanner[2]
        @version = [scanner[3].to_i, scanner[4].to_i]
    
        @state = :headers
        
        if (!Methods[@method])
          raise Http::ParserError::NotImplemented
        end
      elsif (scanner.scan(EmptyLineMatch))
        # ignore an empty line before a request line.
      elsif (scanner.scan(AnyLineMatch))
        raise Http::ParserError::BadRequest
      end
    end
# The HTTP method string used. Will always be a string and all-capsed.
# Valid values are: "GET", "HEAD", "POST", "PUT", "DELETE".
# Other values will cause an exception since then we don't know
# whether the request has a body.
The HTTP method string used. Will always be a string and all-capsed.
The HTTP method string used . Will always be a string and all - capsed .
def parse_request_line(scanner)
      if (scanner.scan(RequestLineMatch))
        @method = scanner[1]
        @path = scanner[2]
        @version = [scanner[3].to_i, scanner[4].to_i]
        @state = :headers
        if (!Methods[@method])
          raise Http::ParserError::NotImplemented
        end
      elsif (scanner.scan(EmptyLineMatch))
      elsif (scanner.scan(AnyLineMatch))
        raise Http::ParserError::BadRequest
      end
    end
def parse_request_line ( scanner ) if ( scanner . scan ( RequestLineMatch ) ) @method = scanner [ 1 ] @path = scanner [ 2 ] @version = [ scanner [ 3 ] . to_i , scanner [ 4 ] . to_i ] @state = :headers if ( ! Methods [ @method ] ) raise Http :: ParserError :: NotImplemented end elsif ( scanner . scan ( EmptyLineMatch ) ) elsif ( scanner . scan ( AnyLineMatch ) ) raise Http :: ParserError :: BadRequest end end
The HTTP method string used.
The HTTP method string used .
# ignore an empty line before a request line.
scanner