|
Accela SDK for Android
V3.0
|
Public Member Functions | |
| RequestParams () | |
| RequestParams (Map< String, String > source) | |
| RequestParams (String rootKey, JSONObject jsonContent) | |
| RequestParams (String key, String value) | |
| void | put (String key, String value) |
| void | put (String key, File file) throws FileNotFoundException |
| void | put (String key, InputStream stream) |
| void | put (String key, InputStream stream, String fileName) |
| void | put (String key, InputStream stream, String fileName, String contentType) |
| void | remove (String key) |
| String | toString () |
| HttpEntity | getEntity () |
| StringEntity | getStringEntity (Boolean isJson) |
| String | getParaValue (String paraName) |
| Boolean | hasKey (String key) |
| String | getJsonString () |
Protected Member Functions | |
| List< BasicNameValuePair > | getParamsList () |
| String | getParamString () |
Protected Attributes | |
| ConcurrentHashMap< String, String > | urlParams |
|
ConcurrentHashMap< String, FileWrapper > | fileParams |
Accela Amobile File: RequestParams.java
Accela, Inc. Copyright (C): 2013
Description: Request parameters wrapper object, used to wrap parameters which will be sent together with HTTP GET/POST/PUT requests.
Notes: A collection of string request parameters or files to send along with requests made from an AsyncHttpClient instance.
For example:
RequestParams params = new RequestParams(); params.put("username", "james"); params.put("password", "123456"); params.put("file1", new File("file.jpg")); // Upload a File params.put("file2", someInputStream); // Upload an InputStream params.put("file3", new ByteArrayInputStream(someBytes)); // Upload some bytes
Revision History@since 1.0
|
inline |
|
inline |
Constructs a new RequestParams instance containing the key/value string parameters from the specified map.
| source | The source key/value string map to add. |
@since 1.0
|
inline |
Constructs a new RequestParams instance containing a JSON object. Typically this constructor is only used in POSTrequest when the post data is a JSON object which contains child JSON objects.
| rootKey | The name of the root key. |
| jsonContent | The JSON object which maps to the root key. |
@since 1.0
|
inline |
Constructs a new RequestParams instance and populate it with a single initial key/value string parameter.
| key | The key name for the initial parameter. |
| value | The value string for the initial parameter. |
@since 1.0
|
inline |
Get the HttpEntity which contains all request parameters
@since 1.0
|
inline |
Convert the key-value parameters to JSON string.
@since 3.0
|
inlineprotected |
Protected method, used to get the list of the current URL parameters.
|
inlineprotected |
Protected method, used to get the string which contains all request parameters.
|
inline |
Get a parameter's value by its name
| paraName | The parameter name. |
@since 1.0
|
inline |
Get the StringEntity which contains all request parameters
| isJson | Indicate whether it is JSON structure. |
@since 1.0
|
inline |
Check whether a parameter exists or not.
| key | A key name. |
@since 1.0
|
inline |
Adds a key/value string pair to the request.
| key | The key name for the new parameter. |
| value | The value string for the new parameter. |
@since 1.0
|
inline |
Adds a file to the request.
| key | The key name for the new parameter. |
| file | The file to add. |
@since 1.0
|
inline |
Adds an input stream to the request.
| key | The key name for the new parameter. |
| stream | The input stream to add. |
@since 1.0
|
inline |
Adds an input stream to the request.
| key | The key name for the new parameter. |
| stream | The input stream to add. |
| fileName | The name of the file. |
@since 1.0
|
inline |
Adds an input stream to the request.
| key | The key name for the new parameter. |
| stream | The input stream to add. |
| fileName | The name of the file. |
| contentType | The content type of the file, eg. application/json. |
@since 1.0
|
inline |
Removes a parameter from the request.
| key | The key name for the parameter to remove. |
@since 1.0
|
inline |
Assemble the current object's content into a string.
@since 1.0