Amazon Submit Feed Error

老子叫甜甜 提交于 2019-12-05 19:26:10

Amazon AWS is very fickle in its signature. Version 2 requires that you use RFC 3986 to encode your data

Add the query string components (the name-value pairs, not including the initial question mark (?) as UTF-8 characters which are URL encoded per RFC 3986 (hexadecimal characters must be uppercased) and sorted using lexicographic byte ordering. Lexicographic byte ordering is case sensitive.

Your problem appears to be with your encoding of the signature.

$signature = urlencode(base64_encode($signature));

That will not conform to RFC 3986. PHP has rawurlencode to do that instead.

$signature = rawurlencode(base64_encode($signature));

Your $string_to_sign seems to be missing the local part of the url as third line. In your case, that part is empty, so you'll just need an additional line break.

$string_to_sign = "GET\nmws.amazonservices.in\n\n" . $url_string;
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!