Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Internet Explorer alert
This browser is not recommended for use with smartdevicelink.com, and may not function properly. Upgrade to a different browser to guarantee support of all features.
close alert
To Top Created with Sketch. To Top
To Bottom Created with Sketch. To Bottom
Android Documentation
HttpRequestTask

Class HttpRequestTask

Hierarchy

java.lang.Object
     android.os.AsyncTask

Package
com.smartdevicelink.util

Fields

REQUEST_TYPE_POST

public static final java.lang.String REQUEST_TYPE_POST
Constant Value
"POST"

REQUEST_TYPE_GET

public static final java.lang.String REQUEST_TYPE_GET
Constant Value
"GET"

REQUEST_TYPE_DELETE

public static final java.lang.String REQUEST_TYPE_DELETE
Constant Value
"DELETE"

Inherited Fields

From Class Fields
android.os.AsyncTask SERIAL_EXECUTOR, THREAD_POOL_EXECUTOR

Constructors

HttpRequestTask( HttpRequestTask.HttpRequestTaskCallback hcb )

public HttpRequestTask(HttpRequestTask.HttpRequestTaskCallback hcb)

Constructor Parameters

hcb
callback for when this task finishes

- When calling execute, params as followed:
1. Url String
2. Request type (Defined in this class) REQUEST_TYPE_POST, REQUEST_TYPE_GET, REQUEST_TYPE_DELETE
3. (Optional) Data to be sent.
4. (Optional) Content Type Default will be application/json
5. (Optional) Accept Type default will be application/json

Methods

doInBackground( java.lang.String[] params )

protected java.lang.String doInBackground(java.lang.String[] params)

Method Parameters

params

Inherited Methods

From Class Methods
android.os.AsyncTask getStatus, doInBackground, onPreExecute, onPostExecute, onProgressUpdate, onCancelled, onCancelled, isCancelled, cancel, get, get, execute, executeOnExecutor, execute, publishProgress
java.lang.Object getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize
View on GitHub.com
Previous Section Next Section