src/EasyCurl.php
public function setHeader($headerName, $headerValue)
    {
        $this->headers[$headerName] = $headerValue;

        $headers = [];

        foreach ($this->headers as $key => $value) {
            $headers[$key] = $value;
        }

        $callback = function ($aval, $akey) {
            return $akey . ': ' . $aval;
        };

        $finishedHeaders = array_map($callback, $headers, array_keys($headers));

        $this->setOpt(CURLOPT_HTTPHEADER, $finishedHeaders);

        return $this;
    }
public function setHeader($headerName, $headerValue)
    {
        $this->headers[$headerName] = $headerValue;

        $headers = [];

        foreach ($this->headers as $key => $value) {
            $headers[$key] = $value;
        }

        $callback = function ($aval, $akey) {
            return $akey . ': ' . $aval;
        };

        $finishedHeaders = array_map($callback, $headers, array_keys($headers));

        $this->setOpt(CURLOPT_HTTPHEADER, $finishedHeaders);

        return $this;
    }
Set header

@param string $headerName
@param string $headerValue

@return $this