com.dg.libs.rest.requests.EntityHttpRequestImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of android-rest Show documentation
Show all versions of android-rest Show documentation
This is a library for android for Making RestFul Requests
package com.dg.libs.rest.requests;
import android.content.Context;
import com.dg.libs.rest.callbacks.HttpCallback;
import com.dg.libs.rest.client.BaseRestClient.RequestMethod;
import com.dg.libs.rest.client.EntityBodyRestClient;
import com.dg.libs.rest.client.Rest;
import com.dg.libs.rest.parsers.HttpResponseParser;
import org.apache.http.HttpEntity;
public abstract class EntityHttpRequestImpl extends BaseHttpRequestImpl {
public static final String TAG = EntityHttpRequestImpl.class.getSimpleName();
protected final EntityBodyRestClient client;
public EntityHttpRequestImpl(final Context context,
RequestMethod requestMethod,
final HttpResponseParser parser,
final HttpCallback callback) {
super(context, parser, callback);
client = new EntityBodyRestClient();
client.setRequestMethod(requestMethod);
}
@Override
protected void doBeforeRunRequestInBackgroundThread() {
super.doBeforeRunRequestInBackgroundThread();
client.setEntity(getEntity());
}
public abstract HttpEntity getEntity();
@Override
public Rest getClient() {
return client;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy