As an excellent worker ,PHP - HTTP_Request2 Access SMS verification code is not easy to get
Some time ago , The worker's stem suddenly caught fire : Working spirit of migrant workers , All part-time workers are masters .
As a senior worker , I want to share with you today PHP - HTTP_Request2 Example of access SMS verification code , I hope you can use it :
`<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://vip.veesing.com/smsAp...');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/x-www-form-urlencoded;charset=utf-8'
));
$request->addPostParameter(array(
'appId' => '41KYR0EB**',
'appKey' => 'IIWCKKSR7NOQ**',
'phone' => '1561894**',
'templateId' => '1043',
'variables' => '1234'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}`
That's all PHP - HTTP_Request2 Example of access SMS verification code , If you think it's useful, just collect it , In case you need , And then I couldn't find it !