lib/Request.php
public function withHeader(string $field, string $value): self {
        $field = \trim($field);
        $lower = \strtolower($field);

        $clone = clone $this;

        $clone->headers[$lower] = [\trim($value)];
        $clone->headerCaseMap[$lower] = $field;

        return $clone;
    }
public function withHeader(string $field, string $value): self {
        $field = \trim($field);
        $lower = \strtolower($field);

        $clone = clone $this;

        $clone->headers[$lower] = [\trim($value)];
        $clone->headerCaseMap[$lower] = $field;

        return $clone;
    }
public function withHeader ( string $ field , string $ value ) : self { $ field = \ trim ( $ field ) ; $ lower = \ strtolower ( $ field ) ; $ clone = clone $ this ; $ clone -> headers [ $ lower ] = [ \ trim ( $ value ) ] ; $ clone -> headerCaseMap [ $ lower ] = $ field ; return $ clone ; }
Assign a value for the specified header field by replacing any existing values for that field.

@param string $field Header name.
@param string $value Header value.

@return Request
Assign a value for the specified header field by replacing any existing values for that field .