Package com.netscape.cmsutil.http
Class HttpMessage
- java.lang.Object
-
- com.netscape.cmsutil.http.HttpMessage
-
- Direct Known Subclasses:
HttpRequest
,HttpResponse
public class HttpMessage extends java.lang.Object
Basic HTTP Message, excluding message body. Not optimized for performance. Set fields or parse from input.
-
-
Constructor Summary
Constructors Constructor Description HttpMessage()
Instantiate a HttpResponse for write to http client.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getContent()
java.lang.String
getHeader(java.lang.String name)
get a headervoid
parse(java.io.BufferedReader reader)
void
readHeaders(java.io.BufferedReader reader)
read http headers.void
reset()
void
setContent(java.lang.String content)
void
setHeader(java.lang.String name, java.lang.String value)
Set a header field.void
write(java.io.OutputStreamWriter writer)
void
writeHeaders(java.io.OutputStreamWriter writer)
write http headers does not support values of more than one line
-
-
-
Method Detail
-
setHeader
public void setHeader(java.lang.String name, java.lang.String value)
Set a header field.
Content-length is automatically set on write.
If value spans multiple lines must be in proper http format for multiple lines.
-
getHeader
public java.lang.String getHeader(java.lang.String name)
get a header
-
writeHeaders
public void writeHeaders(java.io.OutputStreamWriter writer) throws java.io.IOException
write http headers does not support values of more than one line- Throws:
java.io.IOException
-
readHeaders
public void readHeaders(java.io.BufferedReader reader) throws java.io.IOException
read http headers. does not support values of more than one line or multivalue headers.- Throws:
java.io.IOException
-
write
public void write(java.io.OutputStreamWriter writer) throws java.io.IOException
- Throws:
java.io.IOException
-
parse
public void parse(java.io.BufferedReader reader) throws java.io.IOException
- Throws:
java.io.IOException
-
reset
public void reset()
-
setContent
public void setContent(java.lang.String content)
-
getContent
public java.lang.String getContent()
-
-