Has anyone tried and been able to access AWS Translate services?
I have tried MonkeyBread’s curl.SetupAWS() but am getting errors… I have also tried to grow my own class from scratch based on the Python example code provided by Amazon but have not been able to get the signature correct.
(I am able to access AWS S3 services so I do have some clue about this stuff.)
[quote=386966:@James Meyer]Answering my own question for the record… I am finally able to use AWS Translate… I had to debug their PHP SDK to find some undocumented HTTP header and signature requirements.
I’d be curious what you’ve done and/or which headers you’re using as I had no issues with their documentation and authentication. I have 100% pure Xojo code classes for interacting with AWS that don’t use plugins, shell, hacks, or workarounds.
My code is also 100% Xojo (except for the HTTP socket where I use MBS CURL… because Xojo HTTPS leak like a sieve.)
Here is what I had to do to get it to work:
“content_type: application/x-amz-json-1.1” // not 1.0 and it does not need to be part of the signed header.
Add header “x-amz-target: AWSShineFrontendService_20170701.TranslateText” // this does need to be part of the signed header… and I did not find this documented… if you find it please let me know where.
So my signed headers are “host;x-amz-date;x-amz-target”
The entire list of headers is:
My query string is empty and I put the entire json request in the socket payload.
I did not have any problems accessing S3 like I did with Translate. If I had not looked at the Translate PHP SDK I still would not have it working.
I gave up on mixing the old and new framework so did not even tried it… and my current usage is often synchronous which the new framework does directly not support… it was much easier and more powerful to use MBS CURL… especially if you need to debug the connection.