|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ix.util.http.HttpObjectClient ix.util.http.HttpStringClient
public class HttpStringClient
Makes HTTP requests that can be regarded as sending a string and receiving one in reply. The string may of course contain XML if desired.
Certain reasonable assumptions are made about the requests:
At present, only POST requests can be made.
HttpStringServlet
,
HttpServer
Field Summary |
---|
Fields inherited from class ix.util.http.HttpObjectClient |
---|
connectTimeout, readTimeout, requestCharsetName, requestContentType, util |
Constructor Summary | |
---|---|
HttpStringClient()
|
Method Summary | |
---|---|
protected java.lang.String |
decodeReceived(java.lang.String contents)
Turns response contents into an object. |
protected byte[] |
encodeForSend(java.lang.Object obj)
Turns an object into request contents. |
static void |
main(java.lang.String[] argv)
Main program for testing. |
java.lang.String |
sendGetRequest(java.net.URL url)
Send a GET request and get an object in reply. |
java.lang.String |
sendRequest(java.net.URL url,
java.lang.Object contentsToSend)
Send a string and receive one in reply. |
Methods inherited from class ix.util.http.HttpObjectClient |
---|
describeResponse, handleResponseCode, handleResponseCode, mainLoop, readReply, sendBytes, setConnectTimeout, setReadTimeout, setRequestCharsetName, setRequestContentType |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HttpStringClient()
Method Detail |
---|
public java.lang.String sendRequest(java.net.URL url, java.lang.Object contentsToSend)
toString()
method.
sendRequest
in class HttpObjectClient
HttpObjectClient.sendGetRequest(URL)
public java.lang.String sendGetRequest(java.net.URL url)
HttpObjectClient
HttpObjectClient.sendRequest(URL, Object)
.
sendGetRequest
in class HttpObjectClient
protected byte[] encodeForSend(java.lang.Object obj) throws java.io.UnsupportedEncodingException
HttpObjectClient
encodeForSend
in class HttpObjectClient
java.io.UnsupportedEncodingException
HttpObjectClient.decodeReceived(String contents)
protected java.lang.String decodeReceived(java.lang.String contents)
HttpObjectClient
decodeReceived
in class HttpObjectClient
HttpObjectClient.encodeForSend(Object contents)
public static void main(java.lang.String[] argv) throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |