About the PROBLEM of php interface of php interface mainly USES curl curl function
- 2020-07-21 07:00:59
- OfStack
The interface problem
The primary use of the php invocation interface is to use curl to fetch information
The primary use of the php invocation interface is to use curl to fetch information
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url); //url address
curl_setopt($ch, CURLOPT_POST, true); // Whether or not post request
curl_setopt($ch, CURLOPT_POSTFIELDS, $data); //post The data that the request passes
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);// Set up the header
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);// Returns the output text stream obtained
$response = curl_exec($ch); // Gets the returned data
curl_close($ch); // Shut down