AWS API signed POST request with Javascript

守給你的承諾、 提交于 2019-12-07 00:52:27

The Host: header is being filled in and parsed from the given URL by the JS XHR itself when you execute it, same as with curl, e.g.

curl -v -X POST http://example.org/foo

...will automatically add the header Host: example.org...

For AWS you'll still need to add it to the canonical_headers list for signing though (and in all lowercase), as described in your linked example. That part has nothing to do with actually establishing a connection though.

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