About undocumented X-Amz-Target header in Amazon Cognito User Pools APIs

0

I found some posts use X-Amz-Target header to specify the Action to invoke, but I couldn't find any information about X-Amz-Target in Amazon Cognito User Pools API Reference. Where can I learn about X-Amz-Target in Cognito User Pools APIs from AWS official documentations?

profile picture
HS
질문됨 9달 전674회 조회
2개 답변
0
수락된 답변

I asked AWS support, and they said there is no official documentations for 'X-Amz-Target' header. We need to use AWS SDK to send HTTP request, or if we really need to send a plain HTTP request, we need to discover the correct syntax by debugging the AWS SDK.

profile picture
HS
답변함 8달 전
0

Hi,

See https://docs.aws.amazon.com/transfer/latest/userguide/making-api-requests.html

x-amz-target	
This header specifies the version of the API and the operation that you are requesting. 
The target header values are formed by concatenating the API version with the API name 
and are in the following format.

Also this post will detail how it is used in API calls: https://frichetten.com/blog/aws-api-protocols/

Best, Didier

profile pictureAWS
전문가
답변함 9달 전
  • Hi, Didier! Thanks for the response.

    Yes, AWS Transfer Family does support X-Amz-Target header because it is clearly mentioned in its docs, but AWS Cognito User Pools has no information about X-Amz-Target.

    In fact, there are some services don't use X-Amz-Target header to specify Action and not all request methods are POST (e.g., Amazon EC2, Amazon S3) so I feel uncomfortable without finding official information to guarantee the legitimacy of the syntax.

    https://docs.aws.amazon.com/AWSEC2/latest/APIReference/making-api-requests.html#using-libraries https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAPI.html

    Is it the de facto standard that all services use / as request path, POST as request method, X-Amz-Target to specify Action, and require Content-Type to be set to application/x-amz-json-1.1? (I couldn't find the source of that information, either)

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠