Search in sources :

Example 1 with GetBuilder

use of com.benmu.framework.http.okhttp.builder.GetBuilder in project WeexErosFramework by bmfe.

the class AxiosManager method get.

public void get(String mUrl, HashMap<String, String> params, HashMap<String, String> header, StringCallback stringCallback, Object tag, long timeout) {
    mUrl = safeUrl(mUrl);
    if (mUrl == null) {
        if (stringCallback != null) {
            stringCallback.onError(null, new IrregularUrlException("url不合法"), 0);
        }
        return;
    }
    if (header == null) {
        header = new HashMap<>();
    }
    setTimeout(timeout);
    GetBuilder builder = OkHttpUtils.get().url(mUrl).tag(tag).headers(header);
    generateParams(params, builder);
    builder.build().execute(stringCallback);
}
Also used : GetBuilder(com.benmu.framework.http.okhttp.builder.GetBuilder) IrregularUrlException(com.benmu.framework.http.okhttp.exception.IrregularUrlException)

Aggregations

GetBuilder (com.benmu.framework.http.okhttp.builder.GetBuilder)1 IrregularUrlException (com.benmu.framework.http.okhttp.exception.IrregularUrlException)1