组织 ORGANIZATIONS-构造请求:请求消息头

时间:2024-09-06 18:07:04

请求消息头

附加请求头字段,如指定的URI和HTTP方法所要求的字段。例如定义消息体类型的请求头“Content-Type”,请求鉴权信息等。

如下公共消息头需要添加到请求中。

  • Content-Type:消息体的类型(格式),必选,默认取值为“application/json”
  • Authorization:请求消息中可带的签名信息,必选,AK/SK认证的详细说明请参见:AK/SK认证
  • X-Sdk-Date:请求发送的时间,必选,例如:20221107T020014Z。
  • Host:表明主机地址,必选,如organizations.myhuaweicloud.com。

    API支持使用AK/SK认证,AK/SK认证是使用SDK对请求进行签名,签名过程会自动往请求中添加Authorization(签名认证信息)和X-Sdk-Date(请求发送的时间)请求头。AK/SK认证的详细说明请参见:AK/SK认证

对于查询所属组织信息接口,请求如下所示。

GET https://organizations.myhuaweicloud.com/v1/organizations
content-type: application/json
X-Sdk-Date: 20230330T021902Z 
host: organizations.myhuaweicloud.com
Authorization: SDK-HMAC-SHA256 Access=xxxxxxxxxxxxxxxxxxx, SignedHeaders=content-type;host;x-sdk-date, Signature=xxxxxxxxxxxxxxxxxxxx
support.huaweicloud.com/api-organizations/org_04_0018.html