From 70a9b7c414fe3b823e3f53df90c377dba20e2d1f Mon Sep 17 00:00:00 2001 From: "William Thompson Jr." Date: Mon, 11 Aug 2025 17:23:08 -0400 Subject: [PATCH] Allow for custom request headers --- lib/Request.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Request.php b/lib/Request.php index 3442c53..00f7993 100644 --- a/lib/Request.php +++ b/lib/Request.php @@ -20,7 +20,7 @@ abstract class Request * * @return mixed API Request response in requested data format. */ - public static function request($request, $output_format = "xml", $decode_json = false) + public static function request($request, $output_format = "xml", $decode_json = false, $additional_headers = array()) { \RESO\RESO::logMessage("Sending request '".$request."' to RESO API."); @@ -53,6 +53,8 @@ public static function request($request, $output_format = "xml", $decode_json = "Authorization: Bearer ".$token ); + $headers = array_merge($additional_headers, $headers); + // Send request $response = $curl->request("get", $url, $headers, null, false); if(!$response || !is_array($response) || $response[1] != 200) {