Conditions | 4 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
19 | public function send(Request $request) |
||
20 | { |
||
21 | $ch = curl_init($request->getUri()); |
||
22 | |||
23 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
||
24 | |||
25 | if (!empty($request->getHeaders())) { |
||
26 | curl_setopt($ch, CURLOPT_HTTPHEADER, $request->getHeaders()); |
||
27 | } |
||
28 | |||
29 | if ($request->getMethod() === 'POST' && !empty($request->getBody())) { |
||
30 | curl_setopt($ch, CURLOPT_POSTFIELDS, $request->getBody()); |
||
31 | } |
||
32 | |||
33 | $this->response = curl_exec($ch); |
||
34 | curl_close($ch); |
||
35 | } |
||
36 | |||
50 | } |