use of com.benmu.framework.http.okhttp.builder.OtherRequestBuilder in project WeexErosFramework by bmfe.
the class AxiosManager method patch.
public void patch(String url, String content, HashMap<String, String> header, StringCallback callback, Object tag, long timeout) {
url = safeUrl(url);
if (url == null) {
if (callback != null) {
callback.onError(null, new IrregularUrlException("url不合法"), 0);
}
return;
}
if (header == null) {
header = new HashMap<>();
}
setTimeout(timeout);
OtherRequestBuilder builder = OkHttpUtils.patch().url(url).tag(tag).headers(header);
if (content != null) {
builder.requestBody(createRequestBodyByMediaType(header, content));
}
builder.build().execute(callback);
}
use of com.benmu.framework.http.okhttp.builder.OtherRequestBuilder in project WeexErosFramework by bmfe.
the class AxiosManager method delete.
public void delete(String url, String content, HashMap<String, String> header, StringCallback callBack, Object tag, long timeout) {
url = safeUrl(url);
if (url == null) {
if (callBack != null) {
callBack.onError(null, new IrregularUrlException("url不合法"), 0);
}
return;
}
if (header == null) {
header = new HashMap<>();
}
setTimeout(timeout);
OtherRequestBuilder builder = OkHttpUtils.delete().url(url).tag(tag).headers(header);
if (content != null) {
builder.requestBody(createRequestBodyByMediaType(header, content));
}
builder.build().execute(callBack);
}
use of com.benmu.framework.http.okhttp.builder.OtherRequestBuilder in project WeexErosFramework by bmfe.
the class AxiosManager method put.
public void put(String url, String content, HashMap<String, String> header, StringCallback callBack, Object tag, long timeout) {
url = safeUrl(url);
if (url == null) {
if (callBack != null) {
callBack.onError(null, new IrregularUrlException("url不合法"), 0);
}
return;
}
if (header == null) {
header = new HashMap<>();
}
setTimeout(timeout);
OtherRequestBuilder builder = OkHttpUtils.put().url(url).tag(tag).headers(header);
if (content != null) {
builder.requestBody(createRequestBodyByMediaType(header, content));
}
builder.build().execute(callBack);
}
Aggregations