从aws-apigateway-api-sdk android调用方法

问题描述 投票:0回答:1

我有apsway生成的android sdk。我已经包含了生成的jar文件,并将其包含在build_gradle文件中。

以下是sdk代码。任何人都可以告诉我如何在Android应用程序中调用方法?成功登录后,我有来自用户池的用户令牌。我需要使用此令牌来签署对API的请求。

@Service(
    endpoint = "https://xxxxx.execute-api.zzzz.amazonaws.com/yyyy"
)
public interface StagingTestClient {
ApiResponse execute(ApiRequest var1);

@Operation(
    path = "/accounts",
    method = "GET"
)
void accountsGet();

@Operation(
    path = "/accounts",
    method = "POST"
)
void accountsPost();

@Operation(
    path = "/accounts",
    method = "DELETE"
)
void accountsDelete();

@Operation(
    path = "/accounts",
    method = "OPTIONS"
)
void accountsOptions();
}
android amazon-web-services aws-sdk aws-api-gateway
1个回答
0
投票

这在API网关文档中有所介绍:

http://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-generate-sdk-android.html

注意:为了在Android中拥有有意义的SDK,您需要创建请求/响应模型。

© www.soinside.com 2019 - 2024. All rights reserved.