We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 2f97531a authored by Evan Prodromou's avatar Evan Prodromou

add post to curlclient

parent f8a8c14b
......@@ -88,8 +88,27 @@ class CurlClient extends HTTPClient
return $this->parseResults($result);
function post($url, $headers=null)
function post($url, $headers=null, $body=null)
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
if (!is_null($body)) {
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
if (!is_null($headers)) {
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
return $this->parseResults($result);
function setup($ch)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment