Conditions | 2 |
Paths | 2 |
Total Lines | 25 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php namespace Understand\UnderstandLaravel5\Handlers; |
||
12 | protected function send($requestData) |
||
13 | { |
||
14 | $endpoint = $this->getEndpoint(); |
||
15 | |||
16 | $ch = curl_init($endpoint); |
||
17 | curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST'); |
||
18 | curl_setopt($ch, CURLOPT_POSTFIELDS, $requestData); |
||
19 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
||
20 | |||
21 | curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); |
||
22 | curl_setopt($ch, CURLOPT_TIMEOUT, 5); |
||
23 | |||
24 | if ($this->sslBundlePath) |
||
25 | { |
||
26 | curl_setopt($ch, CURLOPT_CAINFO, $this->sslBundlePath); |
||
27 | } |
||
28 | |||
29 | curl_setopt($ch, CURLOPT_USERAGENT, 'Laravel 5 service provider.'); |
||
30 | |||
31 | $response = curl_exec($ch); |
||
32 | |||
33 | curl_close($ch); |
||
34 | |||
35 | return $response; |
||
36 | } |
||
37 | |||
39 |