|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.noderunner.http.BasicHttpClient
public class BasicHttpClient
A very basic HTTP client implementation.
Constructor Summary | |
---|---|
BasicHttpClient(OutputStream os,
InputStream is)
Constructs a BasicHttpClient that communicates over input and output streams. |
|
BasicHttpClient(Socket socket)
Constructs a BasicHttpClient that communicates over a socket. |
Method Summary | |
---|---|
void |
close()
Closes the underlying input and output streams. |
OutputStream |
getOutputStream()
Returns a stream for writing data to, if data is to be sent to the server. |
ClientResponse |
readResponse()
Reads the response data from the HTTP server. |
String |
toString()
Returns debug information. |
void |
writeRequest(ClientRequest request)
Sends the first part of a Request message,
consisting of a request line and headers. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BasicHttpClient(Socket socket) throws IOException
IOException
public BasicHttpClient(OutputStream os, InputStream is)
Method Detail |
---|
public void writeRequest(ClientRequest request) throws IOException
HttpClient
Request
message,
consisting of a request line and headers.
The message body may be sent in one of two ways:
DataPoster
in the client request
object.
HttpClient.getOutputStream()
.
writeRequest
in interface HttpClient
IOException
public OutputStream getOutputStream()
HttpClient
GET
, calling this
method of course makes little sense. Data must be sent if
content-length or transfer encoding headers were sent.
This stream should be wrapped to control output based on the
headers specified in the request.
getOutputStream
in interface HttpClient
public ClientResponse readResponse() throws IOException
HttpClient
readResponse
in interface HttpClient
HttpException
- if the server returned an invalid HTTP
response
IOException
public void close() throws IOException
close
in interface HttpClient
IOException
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |