setHeader('Content-Type', 'application/json'); $curl->post('https://api.github.com/gists', [ 'description' => 'PHP-Curl-Class test.', 'public' => 'true', 'files' => [ 'Untitled.php' => [ 'content' => $content, ], ], ]); echo 'Gist created at ' . $curl->response->html_url . "\n";