@Test public void testAccessTokenExpiredByPostWithJson() throws Exception { setErrorData(HttpURLConnection.HTTP_UNAUTHORIZED, "testErrorMessage".getBytes(CHARSET)); LineApiResponse<String> responseData = target.postWithJson( Uri.parse("https: Collections.<String, String>emptyMap() , "" , new StringResponseParser()); assertFalse(responseData.isSuccess()); assertEquals(LineApiResponseCode.SERVER_ERROR, responseData.getResponseCode()); assertEquals(401, responseData.getErrorData().getHttpResponseCode()); assertEquals("testErrorMessage", responseData.getErrorData().getMessage()); }
@WorkerThread @NonNull public <T> LineApiResponse<T> postWithJson( @NonNull Uri uri, @NonNull Map<String, String> requestHeaders, @NonNull String postData, @NonNull ResponseDataParser<T> responseDataParser) { return sendRequestWithJson(HttpMethod.POST, uri, requestHeaders, postData, responseDataParser); }
ChannelServiceHttpClient { @WorkerThread @NonNull public <T> LineApiResponse<T> postWithJson( @NonNull Uri uri, @NonNull Map<String, String> requestHeaders, @NonNull String postData, @NonNull ResponseDataParser<T> responseDataParser) { return sendRequestWithJson(HttpMethod.POST, uri, requestHeaders, postData, responseDataParser); } }
ChannelServiceHttpClient { @WorkerThread @NonNull public <T> LineApiResponse<T> postWithJson( @NonNull Uri uri, @NonNull Map<String, String> requestHeaders, @NonNull String postData, @NonNull ResponseDataParser<T> responseDataParser) { return sendRequestWithJson(HttpMethod.POST, uri, requestHeaders, postData, responseDataParser); } ChannelServiceHttpClient(@NonNull Context context, @NonNull String lineSdkVersion); @VisibleForTesting protected  ChannelServiceHttpClient(@NonNull UserAgentGenerator userAgentGenerator); }
ChannelServiceHttpClient { @WorkerThread @NonNull public <T> LineApiResponse<T> postWithJson( @NonNull Uri uri, @NonNull Map<String, String> requestHeaders, @NonNull String postData, @NonNull ResponseDataParser<T> responseDataParser) { return sendRequestWithJson(HttpMethod.POST, uri, requestHeaders, postData, responseDataParser); } ChannelServiceHttpClient(@NonNull Context context, @NonNull String lineSdkVersion); @VisibleForTesting protected  ChannelServiceHttpClient(@NonNull UserAgentGenerator userAgentGenerator); void setConnectTimeoutMillis(int connectTimeoutMillis); void setReadTimeoutMillis(int readTimeoutMillis); @WorkerThread @NonNull LineApiResponse<T> post(
            @NonNull Uri uri,
            @NonNull Map<String, String> requestHeaders,
            @NonNull Map<String, String> postData,
            @NonNull ResponseDataParser<T> responseDataParser); @WorkerThread @NonNull LineApiResponse<T> postWithJson(
            @NonNull Uri uri,
            @NonNull Map<String, String> requestHeaders,
            @NonNull String postData,
            @NonNull ResponseDataParser<T> responseDataParser); @WorkerThread @NonNull LineApiResponse<T> putWithJson(
            @NonNull Uri uri,
            @NonNull Map<String, String> requestHeaders,
            @NonNull String postData,
            @Nullable ResponseDataParser<T> responseDataParser); @WorkerThread @NonNull LineApiResponse<T> get(
            @NonNull Uri uri,
            @NonNull Map<String, String> requestHeaders,
            @NonNull Map<String, String> queryParameters,
            @Nullable ResponseDataParser<T> responseDataParser); @WorkerThread @NonNull LineApiResponse<T> delete(
            @NonNull Uri uri,
            @NonNull Map<String, String> requestHeaders,
            @Nullable ResponseDataParser<T> responseDataParser); }
ChannelServiceHttpClient { @WorkerThread @NonNull public <T> LineApiResponse<T> postWithJson( @NonNull Uri uri, @NonNull Map<String, String> requestHeaders, @NonNull String postData, @NonNull ResponseDataParser<T> responseDataParser) { return sendRequestWithJson(HttpMethod.POST, uri, requestHeaders, postData, responseDataParser); } ChannelServiceHttpClient(@NonNull Context context, @NonNull String lineSdkVersion); @VisibleForTesting protected  ChannelServiceHttpClient(@NonNull UserAgentGenerator userAgentGenerator); void setConnectTimeoutMillis(int connectTimeoutMillis); void setReadTimeoutMillis(int readTimeoutMillis); @WorkerThread @NonNull LineApiResponse<T> post(
            @NonNull Uri uri,
            @NonNull Map<String, String> requestHeaders,
            @NonNull Map<String, String> postData,
            @NonNull ResponseDataParser<T> responseDataParser); @WorkerThread @NonNull LineApiResponse<T> postWithJson(
            @NonNull Uri uri,
            @NonNull Map<String, String> requestHeaders,
            @NonNull String postData,
            @NonNull ResponseDataParser<T> responseDataParser); @WorkerThread @NonNull LineApiResponse<T> putWithJson(
            @NonNull Uri uri,
            @NonNull Map<String, String> requestHeaders,
            @NonNull String postData,
            @Nullable ResponseDataParser<T> responseDataParser); @WorkerThread @NonNull LineApiResponse<T> get(
            @NonNull Uri uri,
            @NonNull Map<String, String> requestHeaders,
            @NonNull Map<String, String> queryParameters,
            @Nullable ResponseDataParser<T> responseDataParser); @WorkerThread @NonNull LineApiResponse<T> delete(
            @NonNull Uri uri,
            @NonNull Map<String, String> requestHeaders,
            @Nullable ResponseDataParser<T> responseDataParser);  }