diff --git a/centreon-plugins/centreon/plugins/http.pm b/centreon-plugins/centreon/plugins/http.pm index e474686d1..113d12b74 100644 --- a/centreon-plugins/centreon/plugins/http.pm +++ b/centreon-plugins/centreon/plugins/http.pm @@ -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); diff --git a/centreon-plugins/notification/ovhsms/mode/alert.pm b/centreon-plugins/notification/ovhsms/mode/alert.pm index a7b5630dc..e902dac8a 100644 --- a/centreon-plugins/notification/ovhsms/mode/alert.pm +++ b/centreon-plugins/notification/ovhsms/mode/alert.pm @@ -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 {