public final class YfyRequestUtil extends Object
| Constructor and Description |
|---|
YfyRequestUtil() |
public static String buildUrlWithParams(String host, String path, Map<String,String> params)
public static List<HttpRequestor.Header> addBasicAuthHeader(List<HttpRequestor.Header> headers, String username, String password)
public static List<HttpRequestor.Header> addAuthHeader(List<HttpRequestor.Header> headers, String accessToken)
public static List<HttpRequestor.Header> addApiCustomHeader(List<HttpRequestor.Header> headers, String sdkUserAgentIdentifier)
public static List<HttpRequestor.Header> addDownloadCustomHeader(List<HttpRequestor.Header> headers)
public static <T> T doGetNoAuth(YfyRequestConfig requestConfig, String host, String path, Map<String,String> params, List<HttpRequestor.Header> headers, Class<T> tClass) throws YfyException
YfyExceptionpublic static <T> T doPostInAuth(YfyRequestConfig requestConfig, String host, String path, Map<String,String> params, Class<T> tClass) throws YfyException
YfyExceptionpublic static <T> T doPostNoAuth(YfyRequestConfig requestConfig, String host, String path, YfyArg arg, List<HttpRequestor.Header> headers, Class<T> tClass) throws YfyException
YfyExceptionpublic static <T> T finishResponse(HttpRequestor.Response response, Class<T> tClass) throws YfyException
YfyExceptionpublic static YfyException unexpectedStatus(HttpRequestor.Response response) throws NetworkIOException, JsonReadException
NetworkIOExceptionJsonReadExceptionCopyright © 2017 YiFangYun. All rights reserved.