org.apache.commons.httpclient
Class StatusLine
Represents a Status-Line as returned from a HTTP server.
RFC2616 states
the following regarding the Status-Line:
6.1 Status-Line
The first line of a Response message is the Status-Line, consisting
of the protocol version followed by a numeric status code and its
associated textual phrase, with each element separated by SP
characters. No CR or LF is allowed except in the final CRLF sequence.
Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF
This class is immutable and is inherently thread safe.
Version:
- Jeff Dever
- Mike Bowler
- 2.0
HttpStatus
StatusLine(String statusLine) - Default constructor.
|
StatusLine
public StatusLine(String statusLine)
throws HttpException
Default constructor.
statusLine
- the status line returned from the HTTP server
HttpException
- if the status line is invalid
getHttpVersion
public final String getHttpVersion()
- the HTTP-Version
getReasonPhrase
public final String getReasonPhrase()
- the Reason-Phrase
getStatusCode
public final int getStatusCode()
- the Status-Code
startsWithHTTP
public static boolean startsWithHTTP(String s)
Tests if the string starts with 'HTTP' signature.
s
- string to test
- true if the line starts with 'HTTP'
signature, false otherwise.
toString
public final String toString()
Return a string representation of this object.
- a string represenation of this object.
Copyright (c) 1999-2005 - Apache Software Foundation