#!/usr/bin/perl -w use HTTP::Tiny; use POSIX qw(strftime); my $ua = HTTP::Tiny->new; $timestamp = strftime '%Y-%m-%dT%H:%M:%S', gmtime(); $ip = $ENV{'REMOTE_ADDR'}; $Nonce = int(rand(1000000)); $from = "sfsdfdf"; $message = "asdasd"; $to = "434534543"; my $url = "https://sms-intl.ap-southeast-1.aliyuncs.com"; my $data = { AccessKeyId => "sdsadasdasd", Action => "SendMessageToGlobe", Format => "JSON", From => $from, Message => $message, RegionId => "default", SecureTransport => "true", SignatureMethod => "HMAC-SHA1", SignatureNonce => $Nonce, SignatureVersion => "1.0", SourceIp => $ip, Timestamp => $timestamp, To => $to, Version => "2018-05-01", Signature => "j7UIvC+9whf1KyLxTjv0K4aFCyc=", }; my $params = $ua->www_form_urlencode( $data ); my $response = $ua->post( $url . '/?' . $params ); print "Content-type: text/html\n\n"; print $response->{content} . "\n";