当前位置:网站首页>PHP - curl copy paste access SMS verification code example

PHP - curl copy paste access SMS verification code example

2020-11-09 19:22:00 To work is to master people

Due to the need of the project , I found an access example of SMS verification code that can be directly copied and pasted , Share it now , I hope to improve the work efficiency of all colleagues , The code is as follows :

 

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://vip.veesing.com/smsApi/verifyCode",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "appId=41KYR0EB****&appKey=IIWCKKSR7NOQ****&phone=1561894****&templateId=1043&variables=1234",
  CURLOPT_HTTPHEADER => array(
    "Content-Type: application/x-www-form-urlencoded;charset=utf-8"
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

This is the SMS interface of SMS suppliers in big cloud city , In terms of stability , You can also test , I measured it myself , I think it's very stable , Originality is not easy. , I hope you can give me a three company .

PHP - cURL.php And documentation download

 

版权声明
本文为[To work is to master people]所创,转载请带上原文链接,感谢