Conditions | 2 |
Paths | 2 |
Total Lines | 16 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
38 | public function send() { |
||
39 | $ch = curl_init($this->url); |
||
40 | curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $this->type); |
||
|
|||
41 | curl_setopt($ch, CURLOPT_MAXREDIRS, 5); |
||
42 | curl_setopt($ch, CURLOPT_TIMEOUT, 30); |
||
43 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
||
44 | curl_setopt($ch, CURLOPT_POSTFIELDS, $this->data); |
||
45 | curl_setopt($ch, CURLOPT_HTTPHEADER, $this->headers); |
||
46 | $response = curl_exec($ch); |
||
47 | $err = curl_error($ch); |
||
48 | curl_close($ch); |
||
49 | |||
50 | if($err) { |
||
51 | return $err; |
||
52 | }else { |
||
53 | return $response; |
||
54 | } |
||
56 | } |