diff --git a/src/helper.php b/src/helper.php index cf14d55..3dea013 100644 --- a/src/helper.php +++ b/src/helper.php @@ -1,10 +1,16 @@ all(); + $head = array( + "content-type: application/json" + ); + if (!empty($header)) { + $head = array_merge($head, $header); + } $curl = curl_init(); @@ -17,9 +23,7 @@ function curlHelper($endpoint, $method = 'POST', $payload = [], $log_context = [ CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => $method, CURLOPT_POSTFIELDS => json_encode($payload), - CURLOPT_HTTPHEADER => array( - "content-type: application/json" - ), + CURLOPT_HTTPHEADER => $head, )); $response = curl_exec($curl);