Created
July 20, 2022 16:36
-
-
Save jrmaia/8801e1574058de7a2e48f987635f49b4 to your computer and use it in GitHub Desktop.
curl mova
This file contains hidden or 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
| $curl = curl_init(); | |
| curl_setopt_array($curl, array( | |
| CURLOPT_URL => self::URL, | |
| CURLOPT_RETURNTRANSFER => true, | |
| CURLOPT_ENCODING => "", | |
| CURLOPT_MAXREDIRS => 10, | |
| CURLOPT_TIMEOUT => 30, | |
| CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, | |
| CURLOPT_SSL_VERIFYPEER => false, | |
| CURLOPT_SSL_VERIFYHOST => false, | |
| CURLOPT_CUSTOMREQUEST => "POST", | |
| CURLOPT_POSTFIELDS => json_encode($payload), | |
| CURLOPT_HTTPHEADER => array( | |
| "Content-Type: application/json", | |
| "cache-control: no-cache", | |
| "mova_client_id: {$client_id}", | |
| "x_apikey: {$api_key}", | |
| ), | |
| )); | |
| $response = curl_exec($curl); | |
| $err = curl_error($curl); | |
| $returnCode = (int)curl_getinfo($curl, CURLINFO_HTTP_CODE); | |
| curl_close($curl); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment