Search in sources :

Example 1 with JsonRestRequest

use of com.wordpress.rest.JsonRestRequest in project WordPress-Android by wordpress-mobile.

the class RestClientUtils method post.

/**
     * Make a JSON POST request
     */
public void post(final String path, JSONObject params, RetryPolicy retryPolicy, Listener listener, ErrorListener errorListener) {
    final JsonRestRequest request = mRestClient.makeRequest(mRestClient.getAbsoluteURL(path, getRestLocaleParams(mContext)), params, listener, errorListener);
    if (retryPolicy == null) {
        retryPolicy = new DefaultRetryPolicy(REST_TIMEOUT_MS, REST_MAX_RETRIES_POST, //Do not retry on failure
        REST_BACKOFF_MULT);
    }
    request.setRetryPolicy(retryPolicy);
    AuthenticatorRequest authCheck = new AuthenticatorRequest(request, errorListener, mRestClient, mAuthenticator);
    authCheck.send();
}
Also used : JsonRestRequest(com.wordpress.rest.JsonRestRequest) DefaultRetryPolicy(com.android.volley.DefaultRetryPolicy)

Aggregations

DefaultRetryPolicy (com.android.volley.DefaultRetryPolicy)1 JsonRestRequest (com.wordpress.rest.JsonRestRequest)1