Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $curl = curl_init($this->endPoint);
- $curlopt = [
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_SSL_VERIFYPEER => false,
- CURLOPT_SSL_VERIFYHOST => false,
- CURLOPT_HEADER => false,
- CURLOPT_FAILONERROR => false,
- CURLOPT_HTTP200ALIASES => array(409)
- ];
- if(strtoupper($f['method']) == 'POST'){
- $curlopt[CURLOPT_POST] = TRUE;
- $curlopt[CURLOPT_POSTFIELDS] = $this->format_query($this->parameters);
- } else if(strtoupper($f['method']) != 'GET'){
- $curlopt[CURLOPT_CUSTOMREQUEST] = strtoupper($f['method']);
- $curlopt[CURLOPT_POSTFIELDS] = $this->format_query($this->parameters);
- } elseif(count($f['method'])){
- $url .= strpos($url, '?')? '&' : '?';
- $url .= $this->format_query($this->parameters);
- }
- $curlopt[CURLOPT_URL] = $url;
- curl_setopt_array($curl, $curlopt);
- var_dump($this->parse_response(curl_exec($curl))); // this false
- echo curl_getinfo($curl, CURLINFO_HTTP_CODE); // this is 409
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement