WordPress wp_remote_post not working

I am trying to get response from the URL https://businessenergy.energyhelpline.com/interface/list.php
by using wp_remote_post but that is giving me error with message

Something went wrong: SSL: certificate subject name ‘*.pure360.com’
does not match target host name ‘businessenergy.energyhelpline.com’

Read More

can someone please help me? My code is given below.

$response = wp_remote_post( 'https://businessenergy.energyhelpline.com/interface/list.php', array(
                                                'method' => 'POST',
                                                'timeout' => 45,
                                                'redirection' => 5,
                                                'httpversion' => '1.0',
                                                'blocking' => true,
                                                'headers' => array(),
                                                'body' => array( 'email' => 'abc@abc.com', 'mobile' => '9556638896', 'Business' => 'Business', 'FirstName'=>'abc','LastName'=>'abc', 'listName'=> 'SMS MIC & Ener Bus Combined 190912','accName'=>'businessenergy', 'fullEmailValidationInd'=>'Y', 'successUrl'=>'NO-REDIRECT', 'errorUrl'=>'' ),
                                                'cookies' => array()
                                            )
                                        );

                                        if ( is_wp_error( $response ) ) {
                                           $error_message = $response->get_error_message();
                                           echo "Something went wrong: $error_message";
                                        } else {
                                           echo 'Response:<pre>';
                                           print_r( $response );
                                           echo '</pre>';
                                        }

Related posts

Leave a Reply