AWS API Dlang, hmac sha256 function.

holo via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Oct 9 06:24:38 PDT 2015


I correct typo (thats whats happening when you trying to solve 
problem after night at 6:00 AM ).But still  have same error. When 
use curl with same generated creditentials im getting "400". What 
is strange when im using same generated headers and signature 
with command line curl im getting "500". My headers right now:

auto client = HTTP();
         client.clearRequestHeaders;
         client.addRequestHeader("Content-Type:", 
"application/x-www-form-urlencoded; charset=utf-8");
         client.addRequestHeader("Host:", service ~ 
".amazonaws.com");
         client.addRequestHeader("X-Amz-Date:", xamztime);
         client.addRequestHeader("Authorization:", 
"AWS4-HMAC-SHA256" ~ " " ~ "Credential=" ~ accKey ~ "/" ~ 
xamztime ~ "/" ~ zone ~ "/" ~ service ~ "/" ~ "aws4_request" ~ ", 
" ~ "SignedHeaders=" ~ "content-type;host;x-amz-date" ~ ", " ~ 
"Signature=" ~ signature);

         auto url = service ~ ".amazonaws.com?" ~ 
"Action=DescribeInstances&Version=2013-10-15";
         writeln(url);
         auto content = get(url, client);
         writeln(content);


Did i set up it correctly?


More information about the Digitalmars-d-learn mailing list