我创建了一个AWS移动中心项目,包括Cognito和Cloud逻辑.在我的API网关中,我为授权者设置了Cognito用户池.我使用React native作为我的客户端应用程序.如何将Authorization标头添加到我的API请求中.
const request = {
body: {
attr: value
}
};
API.post(apiName, path, request)
.then(response => {
// Add your code here
console.log(response);
})
.catch(error => {
console.log(error);
});
};
Run Code Online (Sandbox Code Playgroud)