From 6d8b2c33cbb987d309ffcd8e1145985aaa97aa84 Mon Sep 17 00:00:00 2001 From: Jayden Bailey Date: Sat, 23 Nov 2019 09:53:09 +0000 Subject: [PATCH] Add Content-Type header for curl requests --- src/Utils.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Utils.php b/src/Utils.php index 52df1b7..3894e8f 100644 --- a/src/Utils.php +++ b/src/Utils.php @@ -111,6 +111,9 @@ class DiscordUtils { curl_setopt( $c_handlers[$value], CURLOPT_CONNECTTIMEOUT, 10 ); // Add a timeout for connecting to the site curl_setopt( $c_handlers[$value], CURLOPT_TIMEOUT, 10 ); // Do not allow cURL to run for a long time curl_setopt( $c_handlers[$value], CURLOPT_USERAGENT, $user_agent ); // Add a unique user agent + curl_setopt( $c_handlers[$value], CURLOPT_HTTPHEADER, array( + 'Content-Type: application/json' + )); curl_multi_add_handle( $mh, $c_handlers[$value] ); }