|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface HttpServer
Specifies methods for an HTTP server, which is handling a single request from an HTTP client. Methods must be called in specific order for a successful HTTP exchange to take place. The order of calls that must be made is:
Method Summary | |
---|---|
void |
close()
Closes and releases any open connections or resources used by this server. |
OutputStream |
getOutputStream()
Returns a stream for writing data to, if data is to be sent to the client. |
ServerRequest |
readRequest()
Reads the HTTP Request information. |
void |
writeResponse(ServerResponse response)
Sends response data to the HTTP client. |
Method Detail |
---|
ServerRequest readRequest() throws IOException
Request
information.
IllegalHttpStateException
- if the request was already read
IOException
void writeResponse(ServerResponse response) throws IOException
IllegalHttpStateException
- if the request was not yet read
or the response was already sent
HttpException
- if the server returned an invalid HTTP
response
IOException
OutputStream getOutputStream()
IllegalHttpStateException
- if the request was not yet read,
or the response was already sent, or data was sent by a
DataPoster, or this method was already called
void close() throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |