当我试图通过邮递员点击请求时。我正面临一些问题。我在邮递员的aws身份验证中设置了这个: -
“访问密钥: - xxxxxxxxxx
秘密密钥: - xxxxxxxxxx
Aws地区: - ap-south-1
服务名称: - 执行-api“。
当 POST 时出现此错误
{ "message": "The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.\n\nThe Canonical String for this request should have been\n'POST\n/dms/api/v1/filestore/file\n\ncontent-length:29940\ncontent-type:multipart/form-data\nhost:e7ffona9b4.execute-api.ap-south-1.amazonaws.com\nx-amz-date:20170714T111258Z\n\ncontent-length;content-type;host;x-amz-date\n15c77e9022d5c4e9de523e7279515d245695c76115ebabe7517119701f9ae963'\n\nThe String-to-Sign should have been\n'AWS4-HMAC-SHA256\n20170714T111258Z\n20170714/ap-south-1/execute-api/aws4_request\nb0e6151f24eb3a4aa5520da442bdafe7625a44ed7c15f3109eeb78eef038a6cd'\n" }
而 GET 我得到了这个
{ "message": "No method found matching route api/v1/filestore/file for http method GET." }
在代码中我做了类似这样的事情
@RestController
@requestmapping(value = "/v1/filestore")
public class FileUploadController {
@Autowired
private IFileStoreService fileStoreService;
@CrossOrigin
@ResponseBody
@RequestMapping(value = "/file/{id}", method = RequestMethod.GET)
并在 application.properties 中设置
server.contextPath=/api
如果我错了,请告诉我正确的论点,并帮我解决这个问题。
由于
答案 0 :(得分:0)
仔细检查这些:
您指定给对象的密钥不会以句点开头。
粘贴时不应有任何隐形字符。
尝试使用encodeURIComponent()
答案 1 :(得分:0)
调试签名问题可能很困难,可能涉及多个问题。看看你的描述,这是我注意到的一个问题......
在您使用邮递员回复的错误消息中,我们有:
The request signature we calculated does not match the signature...The Canonical String for this request should have been...content-type:multipart/form-data...
API Gateway不支持也不正确处理multipart / form-data