use of com.eros.framework.http.okhttp.exception.IrregularUrlException in project WeexErosFramework by bmfe.
the class AxiosManager method head.
public void head(String url, HashMap<String, String> params, HashMap<String, String> header, Callback 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<>();
}
if (params == null) {
params = new HashMap<>();
}
setTimeout(timeout);
OkHttpUtils.head().url(url).tag(tag).headers(header).params(params).build().execute(callback);
}
use of com.eros.framework.http.okhttp.exception.IrregularUrlException in project WeexErosFramework by bmfe.
the class AxiosManager method put.
public void put(String url, String content, HashMap<String, String> header, Callback 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