|
@@ 149-160 (lines=12) @@
|
| 146 |
|
$this->CurlRequest->setOption(CURLOPT_HTTPHEADER, $headers); |
| 147 |
|
|
| 148 |
|
$resp = $this->CurlRequest->execute(); |
| 149 |
|
if ($this->CurlRequest->getErrorNo() !== 0) { |
| 150 |
|
throw new \RuntimeException('curl error ' . $this->CurlRequest->getError() . '" - Code: ' . $this->CurlRequest->getErrorNo()); |
| 151 |
|
} else { |
| 152 |
|
if ($raw) { |
| 153 |
|
return $resp; |
| 154 |
|
} else { |
| 155 |
|
return [ |
| 156 |
|
'statusCode' => $this->CurlRequest->getInfo(CURLINFO_HTTP_CODE), |
| 157 |
|
'responseBody' => json_decode($resp, true) |
| 158 |
|
]; |
| 159 |
|
} |
| 160 |
|
} |
| 161 |
|
} |
| 162 |
|
|
| 163 |
|
/** |
|
@@ 200-207 (lines=8) @@
|
| 197 |
|
$this->CurlRequest->setOption(CURLOPT_HTTPHEADER, $headers); |
| 198 |
|
|
| 199 |
|
$resp = $this->CurlRequest->execute(); |
| 200 |
|
if ($this->CurlRequest->getErrorNo() !== 0) { |
| 201 |
|
throw new \RuntimeException('curl error ' . $this->CurlRequest->getError() . '" - Code: ' . $this->CurlRequest->getErrorNo()); |
| 202 |
|
} else { |
| 203 |
|
return [ |
| 204 |
|
'statusCode' => $this->CurlRequest->getInfo(CURLINFO_HTTP_CODE), |
| 205 |
|
'responseBody' => json_decode($resp, true) |
| 206 |
|
]; |
| 207 |
|
} |
| 208 |
|
} |
| 209 |
|
|
| 210 |
|
/** |