org.apache.http
Class StatusLine
java.lang.Object
org.apache.http.StatusLine
public class StatusLine
- extends java.lang.Object
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.
- Since:
- 2.0
- Version:
- $Id: StatusLine.java 376961 2006-02-11 10:32:50Z olegk $
- Author:
- Jeff Dever, Mike Bowler
- See Also:
HttpStatus
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
StatusLine
public StatusLine(HttpVersion httpVersion,
int statusCode,
java.lang.String reasonPhrase)
- Default constructor
StatusLine
public StatusLine(HttpVersion httpVersion,
int statusCode)
parse
public static StatusLine parse(CharArrayBuffer buffer,
int indexFrom,
int indexTo)
throws ProtocolException
- Parses the status line returned from the HTTP server.
- Parameters:
buffer
- the buffer from which to parseindexFrom
- where to start parsing in the bufferindexTo
- where to stop parsing in the buffer
- Throws:
HttpException
- if the status line is invalid
ProtocolException
- Since:
- 4.0
parse
public static final StatusLine parse(java.lang.String s)
throws ProtocolException
- Throws:
ProtocolException
getStatusCode
public final int getStatusCode()
- Returns:
- the Status-Code
getHttpVersion
public final HttpVersion getHttpVersion()
- Returns:
- the HTTP-Version
getReasonPhrase
public final java.lang.String getReasonPhrase()
- Returns:
- the Reason-Phrase
toString
public final java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
format
public static void format(CharArrayBuffer buffer,
StatusLine statusline)
format
public static java.lang.String format(StatusLine statusline)
Copyright 2005-2005-2006 Apache Software Foundation. All Rights Reserved.