作者:奔跑的人儿 | 来源:互联网 | 2023-09-13 23:48
本文整理了Java中com.amazonaws.http.AmazonHttpClient.handleResponse()
方法的一些代码示例,展示了AmazonHttpClient.handleResponse()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AmazonHttpClient.handleResponse()
方法的具体详情如下:
包路径:com.amazonaws.http.AmazonHttpClient
类名称:AmazonHttpClient
方法名:handleResponse
AmazonHttpClient.handleResponse介绍
[英]Handles a successful response from a service call by unmarshalling the results using the specified response handler.
[中]通过使用指定的响应处理程序解组结果,处理来自服务调用的成功响应。
代码示例
代码示例来源:origin: aws-amplify/aws-sdk-android
final T respOnse= handleResponse(request, responseHandler,
httpResponse,
executionContext);
代码示例来源:origin: aws-amplify/aws-sdk-android
@Test(expected = CRC32MismatchException.class)
public void testHandleResponseThrowsCRC32MisMatch() throws IOException {
Request> request = new DefaultRequest("ServiceName");
final HttpResponse httpRespOnse= new HttpResponse.Builder().statusText("TestResponse")
.statusCode(200).build();
HttpResponseHandler> respOnseHandler= new HttpResponseHandler>() {
@Override
public AmazonWebServiceResponse handle(HttpResponse response) throws Exception {
assertSame(response, httpResponse);
throw new CRC32MismatchException("test");
}
@Override
public boolean needsConnectionLeftOpen() {
return false;
}
};
client.handleResponse(request, responseHandler, httpResponse,
new ExecutionContext());
}
代码示例来源:origin: aws-amplify/aws-sdk-android
@Test(expected = IOException.class)
public void testHandleResponseThrowsIOException() throws IOException {
Request> request = new DefaultRequest("ServiceName");
final HttpResponse httpRespOnse= new HttpResponse.Builder().statusText("TestResponse")
.statusCode(200).build();
HttpResponseHandler> respOnseHandler= new HttpResponseHandler>() {
@Override
public AmazonWebServiceResponse handle(HttpResponse response) throws Exception {
assertSame(response, httpResponse);
throw new IOException("test");
}
@Override
public boolean needsConnectionLeftOpen() {
return false;
}
};
client.handleResponse(request, responseHandler, httpResponse,
new ExecutionContext());
}
代码示例来源:origin: aws-amplify/aws-sdk-android
@Test(expected = RuntimeException.class)
public void testHandleResponseWithNullResult() throws IOException {
Request> request = new DefaultRequest("ServiceName");
final HttpResponse httpRespOnse= new HttpResponse.Builder().statusText("TestResponse")
.statusCode(200).build();
HttpResponseHandler> respOnseHandler= new HttpResponseHandler>() {
@Override
public AmazonWebServiceResponse handle(HttpResponse response) throws Exception {
assertSame(response, httpResponse);
return null;
}
@Override
public boolean needsConnectionLeftOpen() {
return false;
}
};
client.handleResponse(request, responseHandler, httpResponse,
new ExecutionContext());
}
代码示例来源:origin: aws-amplify/aws-sdk-android
@Test(expected = Exception.class)
public void testHandleResponseThrowsGenericException() throws IOException {
Request> request = new DefaultRequest("ServiceName");
final HttpResponse httpRespOnse= new HttpResponse.Builder().statusText("TestResponse")
.statusCode(200).build();
HttpResponseHandler> respOnseHandler= new HttpResponseHandler>() {
@Override
public AmazonWebServiceResponse handle(HttpResponse response) throws Exception {
assertSame(response, httpResponse);
throw new Exception("test");
}
@Override
public boolean needsConnectionLeftOpen() {
return false;
}
};
client.handleResponse(request, responseHandler, httpResponse,
new ExecutionContext());
}
代码示例来源:origin: aws-amplify/aws-sdk-android
@Test
public void testHandleResponse() throws IOException {
Request> request = new DefaultRequest("ServiceName");
final HttpResponse httpRespOnse= new HttpResponse.Builder().statusText("TestResponse")
.statusCode(200).build();
HttpResponseHandler> respOnseHandler= new HttpResponseHandler>() {
@Override
public AmazonWebServiceResponse handle(HttpResponse response) throws Exception {
assertSame(response, httpResponse);
AmazonWebServiceResponse awsRespOnse= new AmazonWebServiceResponse();
awsResponse.setResult("Result");
return awsResponse;
}
@Override
public boolean needsConnectionLeftOpen() {
return false;
}
};
assertEquals("Result", client.handleResponse(request, responseHandler, httpResponse,
new ExecutionContext()));
}
代码示例来源:origin: com.gluonhq/aws-java-sdk-core
final T respOnse= handleResponse(request, responseHandler,
httpResponse,
executionContext);
代码示例来源:origin: com.amazonaws/aws-android-sdk-core
final T respOnse= handleResponse(request, responseHandler,
httpResponse,
executionContext);