热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

com.amazonaws.http.AmazonHttpClient.handleResponse()方法的使用及代码示例

本文整理了Java中com.amazonaws.http.AmazonHttpClient.handleResponse()方法的一些代码示例,展示了Ama

本文整理了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);

推荐阅读
author-avatar
奔跑的人儿
很傲娇的做一个家伙!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有