-
-
Save Pum-purum/98d62e3eee44286187a3d8ab9a9d22f2 to your computer and use it in GitHub Desktop.
curl php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$method = '/add.new.ajax'; | |
$params = ['field' => 'value']; | |
$queryUrl = 'https://mycoolsite.ru' . $method; | |
$queryData = http_build_query($params); | |
$curl = curl_init(); | |
curl_setopt_array($curl, array( | |
CURLOPT_SSL_VERIFYPEER => false, | |
CURLOPT_POST => 1, | |
CURLOPT_HEADER => 0, | |
CURLOPT_RETURNTRANSFER => 1, | |
CURLOPT_URL => $queryUrl, | |
CURLOPT_POSTFIELDS => $queryData, | |
CURLOPT_VERBOSE => 1)); | |
$result = curl_exec($curl); | |
curl_close($curl); | |
$result = json_decode($result, 1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment