$data = array( 'client_id' => 'testtest', 'client_secret' => 'TheBigSecret', 'redirect_uri' => 'https://oa.dnc.global/web/?action=oauth', 'grant_types' => 'authorization_code', 'scope' => 'openid sli', ); $h = curl_init("https://oa.dnc.global/web/http.api/json/clients/"); curl_setopt($h, CURLOPT_RETURNTRANSFER, true); curl_setopt($h, CURLOPT_TIMEOUT, 10); curl_setopt($h, CURLOPT_POST, true); $data_string = json_encode($data); curl_setopt($h, CURLOPT_POSTFIELDS, $data_string); curl_setopt($h, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen($data_string), 'Accept: application/json') );