Neos\Flow\Http\Request::setContent PHP Method

setContent() public method

In most cases, content is just a string representation of the request body. In order to reduce memory consumption for uploads and other big data, it is also possible to pass a stream resource. The easies way to convert a local file into a stream resource is probably: $resource = fopen('file://path/to/file', 'rb');
public setContent ( string | resource $content ) : void
$content string | resource The body content, for example arguments of a PUT request, or a stream resource
return void
    public function setContent($content)
    {
        if (is_resource($content) && get_resource_type($content) === 'stream' && stream_is_local($content)) {
            $streamMetaData = stream_get_meta_data($content);
            $this->headers->set('Content-Length', filesize($streamMetaData['uri']));
            $this->headers->set('Content-Type', MediaTypes::getMediaTypeFromFilename($streamMetaData['uri']));
        }
        parent::setContent($content);
    }