Fix #1355
This commit is contained in:
parent
7e6b1d9283
commit
b8f8c07cb7
|
@ -238,8 +238,8 @@ sub request {
|
|||
}
|
||||
|
||||
my $uri = URI->new($url);
|
||||
if (defined($request_options->{get_params})) {
|
||||
$uri->query_form($request_options->{get_params});
|
||||
if (defined($self->{get_params})) {
|
||||
$uri->query_form($self->{get_params});
|
||||
}
|
||||
$req = HTTP::Request->new($request_options->{method}, $uri);
|
||||
|
||||
|
|
|
@ -98,20 +98,19 @@ sub run {
|
|||
$self->{http}->add_header(key => 'Content-Type', value => 'text/plain');
|
||||
$self->{http}->add_header(key => 'Accept', value => 'text/plain');
|
||||
|
||||
my $sms_arg = {};
|
||||
|
||||
$sms_arg->{account} = $self->{option_results}->{account};
|
||||
$sms_arg->{login} = $self->{option_results}->{login};
|
||||
$sms_arg->{password} = $self->{option_results}->{password};
|
||||
$sms_arg->{to} = $self->{option_results}->{to};
|
||||
$sms_arg->{from} = $self->{option_results}->{from};
|
||||
$sms_arg->{message} = $self->{option_results}->{message};
|
||||
$sms_arg->{class} = $self->{option_results}->{class};
|
||||
$sms_arg->{noStop} = $self->{option_results}->{nostop};
|
||||
$sms_arg->{contentType} = 'application/json';
|
||||
$sms_arg->{smsCoding} = $self->{option_results}->{smscoding};
|
||||
|
||||
my $response = $self->{http}->request(method => 'GET', get_params => $sms_arg);
|
||||
my $sms_param = [
|
||||
"account=$self->{option_results}->{account}",
|
||||
"login=$self->{option_results}->{login}",
|
||||
"password=$self->{option_results}->{password}",
|
||||
"to=$self->{option_results}->{to}",
|
||||
"from=$self->{option_results}->{from}",
|
||||
"message=$self->{option_results}->{message}",
|
||||
"class=$self->{option_results}->{class}",
|
||||
"noStop=$self->{option_results}->{nostop}",
|
||||
"contentType=application/json",
|
||||
"smsCoding=$self->{option_results}->{smsCoding}",
|
||||
];
|
||||
my $response = $self->{http}->request(method => 'GET', get_param => $sms_param);
|
||||
|
||||
my $decoded;
|
||||
eval {
|
||||
|
|
Loading…
Reference in New Issue