Java Code Examples for com.lzy.okgo.OkGo#post()

The following examples show how to use com.lzy.okgo.OkGo#post() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BaseOkgoApi.java    From BaseProject with Apache License 2.0 5 votes vote down vote up
protected static Request createRequest(String wholeUrl, byte requestMethod) {
    switch (requestMethod) {
        case GET:
            return OkGo.get(wholeUrl);
        case POST:
            return OkGo.post(wholeUrl);
        case PUT:
            return OkGo.put(wholeUrl);
    }
    return null;
}
 
Example 2
Source File: BaseOkgoApi.java    From BaseProject with Apache License 2.0 2 votes vote down vote up
/**
 * 仅仅为构建携带请求参数的Post请求,excute()自行完成(可同步/异步)
 * @param wholeApiUrl 完整APi 请求地址
 * @param appendKeys keys
 * @param keyValues values
 * @return PostRequest
 */
public static PostRequest justPostRequestWithParams(String wholeApiUrl, String[] appendKeys, String... keyValues) {
    PostRequest postRequest = OkGo.post(wholeApiUrl);
    buildCommonRequestParams(postRequest, appendKeys, keyValues);
    return postRequest;
}