+ * @param string $field optional header field. Return all fields if empty
+ *
+ * @return string the Curl headers or the specified content of the header variable
+ */
+ public function getHeader(string $field = '')
+ {
+ if (empty($field)) {
+ return $this->header;
+ }
+
+ $field = strtolower(trim($field));
+
+ $headers = $this->getHeaderArray();
+
+ if (isset($headers[$field])) {
+ return $headers[$field];
+ }
+
+ return '';
+ }
+
+ /**
+ * Check if a specified header exists
+ *
+ * @param string $field header field
+ *
+ * @return boolean "true" if header exists
+ */
+ public function inHeader(string $field)
+ {
+ $field = strtolower(trim($field));
+
+ $headers = $this->getHeaderArray();
+
+ return array_key_exists($field, $headers);
+ }
+
+ /**
+ * Returns the Curl headers as an associated array
+ *
+ * @return array associated header array