in reply to Re^6: alibaba cloud sms api
in thread alibaba cloud sms api
If it's any help, the Ruby code posted the following parameters
AccessKeyId => <accessKeyId> Action => SendSms Format => JSON PhoneNumbers => 7766 RegionId => default SignName => iiuy SignatureMethod => HMAC-SHA1 SignatureNonce => 7e44843695e9a68247e15d3beb018b63 SignatureVersion => 1.0 TemplateCode => jkk Timestamp => 2019-09-02T16:28:32Z Version => 2017-05-25 Signature => TquzjlguNxK2WdUVVrfm4yYTHZI=
code snippet from rpc_client.rb
def default_params default_params = { 'Format' => 'JSON', 'SignatureMethod' => 'HMAC-SHA1', 'SignatureNonce' => SecureRandom.hex(16), 'SignatureVersion' => '1.0', 'Timestamp' => Time.now.utc.strftime('%Y-%m-%dT%H:%M:%S +Z'), 'AccessKeyId' => self.access_key_id, 'Version' => self.api_version, } default_params.merge!('SecurityToken' => self.security_token) if + self.security_token
Also this looks wrong
$req->header('Content-Type' => 'application/json; charset=UTF-8');
The content-type in the header was
application/x-www-form-urlencodedpoj
|
---|