An instance of this class is a HTTP request to send or already sent to the server. More...
Public Member Functions | |
| Request (String method, String baseUrl, String path, String[] headers, String body) | |
| Request (String json) | |
| Request (JSONObject jso) | |
| int | getId () |
| String | getMethod () |
| String | getBaseUrl () |
| String | getPath () |
| String | getUrl () |
| String [] | getHeaders () |
| String | getBody () |
| boolean | hasSSL () |
| JSONObject | toJSON () |
| String | toString () |
Static Public Attributes | |
| static final String | GET = "GET" |
| static final String | POST = "POST" |
| static final String | PUT = "PUT" |
| static final String | PATCH = "PATCH" |
| static final String | DELETE = "DELETE" |
| static final String | K_METHOD = "method" |
| static final String | K_HEADER = "headers" |
| static final String | K_BODY = "body" |
| static final String | K_BASEURL = "baseurl" |
| static final String | K_PATH = "path" |
Protected Member Functions | |
| void | fromJSON (JSONObject jso) |
| void | fromJSON (String json) |
| void | fromString (String json) |
Package Attributes | |
| int | id = 0 |
An instance of this class is a HTTP request to send or already sent to the server.
| Request | ( | String | method, |
| String | baseUrl, | ||
| String | path, | ||
| String [] | headers, | ||
| String | body | ||
| ) |
Create a new instance of this class.
| method | the HTTP method, one of GET, POST, PUT, PATCH or DELETE |
| baseUrl | the base URL (without the path part) of this request |
| path | the path part of the request URL |
| headers | array of headers to send during the request; the even elements are the header names, while the odd ones are the corresponding values |
| body | the body of the HTTP request or null for empty body |
| Request | ( | String | json | ) |
Create a new instance of this class from a JSON string (previously produced by calling toString()).
| json | the JSON string to parse for creating this request |
| Request | ( | JSONObject | jso | ) |
Create a new instance of this class from a JSON object (previously produced by calling toJSON()).
| jso | the JSON object to use for creating this request |
|
protected |
|
protected |
|
protected |
| String getBaseUrl | ( | ) |
HTTP base URL getter.
| String getBody | ( | ) |
HTTP body getter.
| String [] getHeaders | ( | ) |
HTTP headers getter.
| int getId | ( | ) |
| String getMethod | ( | ) |
HTTP method getter.
| String getPath | ( | ) |
HTTP URL path getter.
| String getUrl | ( | ) |
HTTP full URL getter.
| boolean hasSSL | ( | ) |
| JSONObject toJSON | ( | ) |
Make a JSON object representation of this request. Such JSON instance can be used to create a new request instance by calling Request(JSONObject).
| String toString | ( | ) |
Make a JSON string representation of this request. Such JSON instance can be used to create a new request instance by calling Request(String).
|
static |
|
static |
|
package |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |