【问题标题】:Build an ajax request with jquery, add header and body用jquery构建ajax请求,添加header和body
【发布时间】:2015-11-16 11:06:53
【问题描述】:

如何使用 $.ajax 或 $.post 使用这些信息构建 Jquery 请求:

POST /CreateSpeech HTTP/1.1

Host: tts.eu-west-1.ivonacloud.com

Content-type: application/json

X-Amz-Date: 20130913T092054Z

Authorization: AWS4-HMAC-SHA256 Credential=12345/20130913/eu-west-1/tts/aws4_request, 

SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, 

Signature=38c394cf938da94ec503f501a91055bc9aa339d165695884b9e7e60128f6ad27

x-amz-content-sha256: f43e25253839f2c3feae433c5e477d79f7dfafdc0e4af19a952adb44a60265ba

Content-Length: 32

{"Input":{"Data":"Hello world"}}

【问题讨论】:

    标签: javascript jquery ajax post


    【解决方案1】:

    This has been answered here

    您需要在 headers 属性中添加标题信息(不要放在第一行),然后像往常一样在 data 属性中添加内容。

    【讨论】:

      猜你喜欢
      • 2022-07-25
      • 2018-08-09
      • 2021-04-10
      • 1970-01-01
      • 2018-02-09
      • 1970-01-01
      • 2023-03-10
      • 2015-09-07
      • 1970-01-01
      相关资源
      最近更新 更多