I believe the problem is that Perl's "encode_base64" function appends a newline to its output value.  You need to suppress this behavior by adding an empty string as the second argument.  The 2-minute delay you were seeing was because you specified Content-Length:200 but didn't send any data.  The server was waiting until it timed out.  You should either set Content-Length:0 or use --data-binary=[NAME] to send a file.  Here's my updated code.  I also removed the extra $Date from the signature and just kept the newline.  #!/usr/bin/perl use strict; use Time::Local; use MIME::Base64; use Digest::SHA qw(hmac_sha1);     sub _MyUTCTime(){ my [NAME]=split(" ",scalar gmtime()); my ($Wkday,$Mon,$Day,$time,$year) = [NAME]; my $UTCTime = $Wkday . ", " . $Day . " $Mon" . " $year " . $time . " GMT"; return $UTCTime; }  my $UserID='6/c'; my $SharedSecret = 'wA=';   my $HTTPRequestMethod = 'POST'; my $ContentType = "application/octet-stream"; my $Range = ""; my $Date= _MyUTCTime; my $CanonicalizedResource = '/rest/objects'; my $CanonicalizedEMCHeaders = 'x-emc-date:'.$Date."\n".'x-emc-uid:'.$UserID;  my $HashString = $HTTPRequestMethod . "\n" . $ContentType . "\n" . $Range . "\n". "\n".$CanonicalizedResource . "\n" . $CanonicalizedEMCHeaders;  print "StringToSign:\n$HashString\n";  my $DecodedSharedSecret = decode_base64($SharedSecret);  my $digest=hmac_sha1($HashString,$DecodedSharedSecret);  my $EMCSignature= encode_base64($digest, "");  my $cmd =  `curl -k -s -v -H "Content-Type:$ContentType" -H "Content-Length:0" -H "x-emc-date:$Date" -H "x-emc-uid:$UserID" -H "x-emc-signature:$EMCSignature" -X POST api.atmosonline.com/rest/objects`;  print $cmd;    And the output:   ~$ ./atmostest.pl  StringToSign: POST application/octet-stream   /rest/objects x-emc-date:Fri, 13 Jul 2012 17:52:11 GMT x-emc-uid:6c91fae4fc1f427a9b101ae92d35b0b7/A13067272264222607fc * About to connect() to api.atmosonline.com port 80 (#0) *   Trying 74.112.146.139... connected > POST /rest/objects HTTP/1.1 > User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3 > Host: api.atmosonline.com > Accept: */* > Content-Type:application/octet-stream > Content-Length:0 > x-emc-date:Fri, 13 Jul 2012 17:52:11 GMT > x-emc-uid:6c91fae4fc1f427a9b101ae92d35b0b7/A13067272264222607fc > x-emc-signature:jMsuseufdo/2XB+y0rzD48uMjos= >  < HTTP/1.1 201 Created < Server: Apache < Content-Type: text/plain; charset=UTF-8 < Date: Fri, 13 Jul 2012 17:52:11 GMT < location: /rest/objects/4ee696e4a31f549804f0b909b451ee05000604bf202b < x-emc-delta: 0 < x-emc-policy: default < Connection: Keep-Alive < Content-Length: 0 <  * Connection #0 to host api.atmosonline.com left intact * Closing connection #0 
Hi, Sorry if this is a repost, but I could not find a solution from any thread I hit on earlier.  I know that the procedure I use to get x-emc-signature is correct, however I get the following while executing any httpmethod.            1032         There was a mismatch between the signature in the request and t                                                                                                                           he signature computed by the server.    This is what I do to get the x-emc-signature:  HTTPRequestMethod + '\n' + ContentType + '\n' + Range + '\n' + Date + '\n' + CanonicalizedResource + '\n' +                CanonicalizedEMCHeaders      3. decode_base64($SecretKey)      4. encode_base64(hmac_sha1($HashString,decode_base64($SecretKey))  My account is enabled and on a portal, there is a link that tests the subtenant by running a POST object and DELETE object calls. This test was successful, and I used the timestamp from that request, keyed it into my code and compared the signatures, they match, and that is why I think my signatures are correct.   However when I run my perl program, I get the error mentioned.  Just for confirmation, following is the format of date I put in after reordering the output of gmtime(); Tue, 4 Jul 2012 04:27:53 GMT  In canonicalized EMCHeaders, i use x-emc-uid alone.  Following is my $HashString  POST application/octet-stream  Wed, 4 Jul 2012 04:27:53 GMT /rest/objects x-emc-uid:d3ade228823c412b8a3460084e7917e2/atmosugrATsa724pDOTin  Following is my signature:  BQ5tLNWDF9iTmpyZTzqu26NN2uM=  Following is my call:  `curl -v --basic -u "$Account:$Passwd" -H "Accept:*/*" -H "Content-type:Application/octet-stream" -H "Host:$Host" -H "Date:$Date" -H "x-emc-uid:$UserID" -H "x-emc-signature:$EMCSignature" -X POST $Host/rest/objects`;  Please help, I am not quite sure what I am missing. 
Error 1032 while executing REST API Calls