Package totalcross.xml.rpc
Class CompressedHttpClient
- java.lang.Object
-
- totalcross.xml.rpc.StandardHttpClient
-
- totalcross.xml.rpc.CompressedHttpClient
-
public class CompressedHttpClient extends StandardHttpClient
-
-
Constructor Summary
Constructors Constructor Description CompressedHttpClient(java.lang.String hostname, int port, java.lang.String uri)CompressedHttpClient(java.lang.String hostname, int port, java.lang.String uri, int openTimeout, int readTimeout, int writeTimeout)See the constructor for the StandardHttpClient
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringexecute(byte[] requestBody)Executes a HTTP request to the connected serverbyte[]executeReturnBytes(byte[] requestBody)Executes a HTTP request to the connected serverprotected java.lang.StringBufferwriteRequestHeader(int requestLength)Writes the headers for a HTTP request, adding the deflate method as content-encoding.-
Methods inherited from class totalcross.xml.rpc.StandardHttpClient
checkResponse, closeConnection, parseHeader, privateReadResponse, readLine, readResponse, readResponseBytes, setBasicAuthentication, writeRequest
-
-
-
-
Constructor Detail
-
CompressedHttpClient
public CompressedHttpClient(java.lang.String hostname, int port, java.lang.String uri, int openTimeout, int readTimeout, int writeTimeout) throws XmlRpcException, UnknownHostExceptionSee the constructor for the StandardHttpClient- Throws:
XmlRpcExceptionUnknownHostException
-
CompressedHttpClient
public CompressedHttpClient(java.lang.String hostname, int port, java.lang.String uri) throws XmlRpcException, UnknownHostException- Throws:
XmlRpcExceptionUnknownHostException
-
-
Method Detail
-
execute
public java.lang.String execute(byte[] requestBody) throws XmlRpcExceptionExecutes a HTTP request to the connected server- Overrides:
executein classStandardHttpClient- Parameters:
requestBody- The contents of the HTTP request. Headers are added appropriately by this method after the request is compressed- Throws:
XmlRpcException- If the server returns a status code other than 200 OK
-
executeReturnBytes
public byte[] executeReturnBytes(byte[] requestBody) throws XmlRpcExceptionExecutes a HTTP request to the connected server- Overrides:
executeReturnBytesin classStandardHttpClient- Parameters:
requestBody- The contents of the HTTP request. Headers are added appropriately by this method after the request is compressed- Throws:
XmlRpcException- If the server returns a status code other than 200 OK
-
writeRequestHeader
protected java.lang.StringBuffer writeRequestHeader(int requestLength)
Writes the headers for a HTTP request, adding the deflate method as content-encoding.- Overrides:
writeRequestHeaderin classStandardHttpClient
-
-