public function getRequestHeaders(): array
    {
        $headers = clone $this->headers();

        if (!$headers->headerExists('Content-type')) {
            if ($contentType = $this->getContentType()) {
                if (($charset = $this->getCharset()) && (stripos($contentType, 'charset=') === false)) {
                    $contentType .= "; charset={$charset}";
                }

                $headers->setHeader('Content-type', $contentType);
            }
        }

        return $headers->getHeadersForRequest();
    }
public function getRequestHeaders(): array
    {
        $headers = clone $this->headers();

        if (!$headers->headerExists('Content-type')) {
            if ($contentType = $this->getContentType()) {
                if (($charset = $this->getCharset()) && (stripos($contentType, 'charset=') === false)) {
                    $contentType .= "; charset={$charset}";
                }

                $headers->setHeader('Content-type', $contentType);
            }
        }

        return $headers->getHeadersForRequest();
    }
public function getRequestHeaders ( ) : array { $ headers = clone $ this -> headers ( ) ; if ( ! $ headers -> headerExists ( 'Content-type' ) ) { if ( $ contentType = $ this -> getContentType ( ) ) { if ( ( $ charset = $ this -> getCharset ( ) ) && ( stripos ( $ contentType , 'charset=' ) === false ) ) { $ contentType .= "; charset={$charset}" ; } $ headers -> setHeader ( 'Content-type' , $ contentType ) ; } } return $ headers -> getHeadersForRequest ( ) ; }
Get headers prepared for request with Content-type assigned if it was not already set

@return array
Get headers prepared for request with Content - type assigned if it was not already set