@@ 113-117 (lines=5) @@ | ||
110 | ||
111 | if ($method == 'POST') { |
|
112 | curl_setopt($this->curl, CURLOPT_POST, true); |
|
113 | if (!empty($data)) { |
|
114 | curl_setopt($this->curl, CURLOPT_POSTFIELDS, http_build_query($data)); |
|
115 | } else { |
|
116 | curl_setopt($this->curl, CURLOPT_POSTFIELDS, array()); |
|
117 | } |
|
118 | } elseif ($method == 'PUT') { |
|
119 | curl_setopt($this->curl, CURLOPT_PUT, true); |
|
120 | if (!empty($data)) { |
|
@@ 120-124 (lines=5) @@ | ||
117 | } |
|
118 | } elseif ($method == 'PUT') { |
|
119 | curl_setopt($this->curl, CURLOPT_PUT, true); |
|
120 | if (!empty($data)) { |
|
121 | curl_setopt($this->curl, CURLOPT_POSTFIELDS, http_build_query($data)); |
|
122 | } else { |
|
123 | curl_setopt($this->curl, CURLOPT_POSTFIELDS, array()); |
|
124 | } |
|
125 | } elseif ($method == 'DELETE') { |
|
126 | curl_setopt($this->curl, CURLOPT_CUSTOMREQUEST, "DELETE"); |
|
127 | if (!empty($data)) { |
|
@@ 127-131 (lines=5) @@ | ||
124 | } |
|
125 | } elseif ($method == 'DELETE') { |
|
126 | curl_setopt($this->curl, CURLOPT_CUSTOMREQUEST, "DELETE"); |
|
127 | if (!empty($data)) { |
|
128 | curl_setopt($this->curl, CURLOPT_POSTFIELDS, http_build_query($data)); |
|
129 | } else { |
|
130 | curl_setopt($this->curl, CURLOPT_POSTFIELDS, array()); |
|
131 | } |
|
132 | } |
|
133 | ||
134 | $content = curl_exec($this->curl); |