public function setHeader(string $name, $value) {
        $key = strtolower($name);

        if ($value === null) {
            unset($this->headerNames[$key], $this->headers[$key]);
        } else {
            $this->headerNames[$key] = $name;
            $this->headers[$key] = (array)$value;
        }

        return $this;
    }
public function setHeader(string $name, $value) {
        $key = strtolower($name);

        if ($value === null) {
            unset($this->headerNames[$key], $this->headers[$key]);
        } else {
            $this->headerNames[$key] = $name;
            $this->headers[$key] = (array)$value;
        }

        return $this;
    }
public function setHeader ( string $ name , $ value ) { $ key = strtolower ( $ name ) ; if ( $ value === null ) { unset ( $ this -> headerNames [ $ key ] , $ this -> headers [ $ key ] ) ; } else { $ this -> headerNames [ $ key ] = $ name ; $ this -> headers [ $ key ] = ( array ) $ value ; } return $ this ; }
Set a header by case-insensitive name. Setting a header will overwrite the current value for the header.

@param string $name The name of the header.
@param string|string[]|null $value The value of the new header. Pass `null` to remove the header.
@return HttpMessage Returns $this for fluent calls.
Set a header by case - insensitive name . Setting a header will overwrite the current value for the header .