I have used the synchronous version of the textract api without a problem. And now trying the async version.
- Feedback : The API seems to expect the request to be uploaded with content-type as multipart/form-data but I cannot see this mentioned in the documentation. Would suggest an update to the documentation to this effect.
- Problem : I am using the same 'signing' logic as used for the sync function call but I get an error
. x-amz-content-sha256 must be UNSIGNED-PAYLOAD, STREAMING-UNSIGNED-PAYLOAD-TRAILER, STREAMING-AWS4-HMAC-SHA256-PAYLOAD, STREAMING-AWS4-HMAC-SHA256-PAYLOAD-TRAILER, STREAMING-AWS4-ECDSA-P256-SHA256-PAYLOAD, STREAMING-AWS4-ECDSA-P256-SHA256-PAYLOAD-TRAILER or a valid sha256 value
The http status code returned is 400.
I have computed the hash value of the entire content being POST-ed.
Even if I compute the hash value of the request alone, I get the same error.
Could you provide any link to the documentation which explains how this data is to the POST-ed. Or could you suggest how it is to be done.
I am not using the AWS SDKs and would prefer not to for certain customer specific considerations.
Thanks
Kimman
Sample data POST-ed.
Content-Type: multipart/form-data
X-Amz-Target: Textract.StartDocumentTextDetection
X-Amz-Content-Sha256: e9f823f830156d0fd7d5eb6f99dd5194a1407206a0e3e88cbd13b4b2c4350091
Content-Length: 580
X-Amz-Date: 20230223T054757Z
Host: textract.ap-south-1.amazonaws.com
Authorization: AWS4-HMAC-SHA256 Credential=AKIAUKQ7DYLA4QD54GHV/20230223/ap-south-1/textract/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-content-sha256;x-amz-date;x-amz-target, Signature=2a3f334d2acc53696d887a59eb2277f7ca0caf68cbf932fbe3f7837d6818c2d0
My mistake .. I was POST-ing to S3 instead of Textract and hence the error message.