Accela SDK for Android  V3.0
 All Classes Functions Variables Pages
com.accela.mobile.http.SyncHttpClient Class Reference

Public Member Functions

 SyncHttpClient ()
 
void setCookieStore (CookieStore cookieStore)
 
void setUserAgent (String userAgent)
 
void setSSLSocketFactory (SSLSocketFactory sslSocketFactory)
 
void addHeader (String header, String value)
 
JSONObject get (String url)
 
JSONObject post (String url, RequestParams params)
 
JSONObject post (String url, HttpEntity entity, String contentType)
 
JSONObject put (String url, RequestParams params)
 
JSONObject put (String url, HttpEntity entity, String contentType)
 
JSONObject delete (String url)
 
String assembleUrlWithParams (String url, RequestParams params)
 
Map< String, String > getHeader ()
 
Header[] getHttpResponseHeader ()
 
void clearHttpResponseHeader ()
 
String getHttpResponse ()
 
void clearHttpResponseBody ()
 
Boolean isLoading ()
 

Detailed Description

 Accela Amobile
 File: SyncHttpClient.java
 Accela, Inc.
 Copyright (C): 2012
 Description:
 HTTP Client wrapper, used to process synchronous HTTP requests.
 Notes:
 Revision History

   @since 1.0
 

Constructor & Destructor Documentation

com.accela.mobile.http.SyncHttpClient.SyncHttpClient ( )
inline

Constructor without parameters.

Returns
An initialized SyncHttpClient instance
Since
1.0

Member Function Documentation

void com.accela.mobile.http.SyncHttpClient.addHeader ( String  header,
String  value 
)
inline

Sets headers that will be added to the current request.

Parameters
headerThe name of the header.
valueThe contents of the header.
Returns
Void.
Since
1.0
String com.accela.mobile.http.SyncHttpClient.assembleUrlWithParams ( String  url,
RequestParams  params 
)
inline

Append reqeust parameters to URL.

Parameters
urlThe URL to send the request to.
paramsAdditional URL parameters which will be appened to the URL.
Returns
A new URL string which contains the parameter key-value pairs.
Since
1.0
void com.accela.mobile.http.SyncHttpClient.clearHttpResponseBody ( )
inline

Clear reponse data.

Returns
Void
Since
2.1
void com.accela.mobile.http.SyncHttpClient.clearHttpResponseHeader ( )
inline

Clear header list.

Returns
Void
Since
2.1
JSONObject com.accela.mobile.http.SyncHttpClient.delete ( String  url)
inline

Perform a HTTP DELETE request.

Parameters
urlThe URL to send the request to.
Returns
Void.
Since
1.0
JSONObject com.accela.mobile.http.SyncHttpClient.get ( String  url)
inline

Perform a HTTP GET request, without any parameters.

Parameters
urlThe URL to send the request to.
Returns
A Json object which contains the response returned from server.
Since
1.0
Map<String, String> com.accela.mobile.http.SyncHttpClient.getHeader ( )
inline

Get client's header map.

Returns
The map which contains client header data..
Since
1.0
String com.accela.mobile.http.SyncHttpClient.getHttpResponse ( )
inline

Get response's data string.

Returns
The the original string of HTTP response
Since
1.0
Header [] com.accela.mobile.http.SyncHttpClient.getHttpResponseHeader ( )
inline

Get response's header list.

Returns
The array which contains header of HTTP response
Since
1.0
Boolean com.accela.mobile.http.SyncHttpClient.isLoading ( )
inline

Get the loading status of current request

Returns
true or false
Since
1.0
JSONObject com.accela.mobile.http.SyncHttpClient.post ( String  url,
RequestParams  params 
)
inline

Perform a HTTP POST request, without the given post parameters.

Parameters
urlThe URL to send the request to.
paramsAdditional POST parameters to send with the request.
Returns
Void.
Since
1.0
JSONObject com.accela.mobile.http.SyncHttpClient.post ( String  url,
HttpEntity  entity,
String  contentType 
)
inline

Perform a HTTP POST request with the given http entity.

Parameters
urlThe URL to send the request to.
entityA raw HttpEntity to send with the request, for example, use this to send string/json/xml payloads to a server by passing a org.apache.http.entity.StringEntity.
contentTypeThe content type of the payload you are sending, for example application/json if sending a json payload.
Returns
Void.
Since
1.0
JSONObject com.accela.mobile.http.SyncHttpClient.put ( String  url,
RequestParams  params 
)
inline

Perform a HTTP PUT request with the given put parameters.

Parameters
urlThe URL to send the request to.
paramsAdditional PUT parameters or files to send with the request.
Returns
Void.
Since
1.0
JSONObject com.accela.mobile.http.SyncHttpClient.put ( String  url,
HttpEntity  entity,
String  contentType 
)
inline

Perform a HTTP PUT request with the given http entity.

Parameters
urlThe URL to send the request to.
entityA raw HttpEntity to send with the request, for example, use this to send string/json/xml payloads to a server by passing a org.apache.http.entity.StringEntity.
contentTypeThe content type of the payload you are sending.
Returns
Void.
Since
1.0
void com.accela.mobile.http.SyncHttpClient.setCookieStore ( CookieStore  cookieStore)
inline

Sets an optional CookieStore to use when making requests

Parameters
cookieStoreThe CookieStore implementation to use, usually an instance of PersistentCookieStore
Returns
Void.
Since
1.0
void com.accela.mobile.http.SyncHttpClient.setSSLSocketFactory ( SSLSocketFactory  sslSocketFactory)
inline

Sets the SSLSocketFactory to user when making requests. By default, a new, default SSLSocketFactory is used.

Parameters
sslSocketFactoryThe socket factory to use for https requests.
Returns
Void.
Since
1.0
void com.accela.mobile.http.SyncHttpClient.setUserAgent ( String  userAgent)
inline

Sets the User-Agent header to be sent with the current request.

Parameters
userAgentThe string to use in the User-Agent header.
Returns
Void.
Since
1.0

The documentation for this class was generated from the following file: