com.dg.libs.rest.requests.StringBodyHttpRequestImpl 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 java.io.UnsupportedEncodingException;
import org.apache.http.HttpEntity;
import org.apache.http.entity.StringEntity;
import android.content.Context;
import com.araneaapps.android.libs.logger.ALog;
import com.dg.libs.rest.callbacks.HttpCallback;
import com.dg.libs.rest.client.BaseRestClient.RequestMethod;
import com.dg.libs.rest.parsers.HttpResponseParser;
public abstract class StringBodyHttpRequestImpl extends EntityHttpRequestImpl {
public static final String TAG = StringBodyHttpRequestImpl.class.getSimpleName();
public StringBodyHttpRequestImpl(final Context context, RequestMethod requestMethod,
final HttpResponseParser parser, final HttpCallback callback) {
super(context, requestMethod, parser, callback);
}
public abstract String bodyContents();
@Override
public HttpEntity getEntity() {
try {
return new StringEntity(bodyContents(), "UTF-8");
} catch (UnsupportedEncodingException e) {
ALog.e(e);
}
return null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy