src/Context/ApiContext.php
public function setRequestBody($string) {
        if (!empty($this->requestOptions['multipart']) || !empty($this->requestOptions['form_params'])) {
            throw new InvalidArgumentException(
                'It\'s not allowed to set a request body when using multipart/form-data or form parameters.'
            );
        }

        $this->request = $this->request->withBody(Psr7\stream_for($string));

        return $this;
    }
public function setRequestBody($string) {
        if (!empty($this->requestOptions['multipart']) || !empty($this->requestOptions['form_params'])) {
            throw new InvalidArgumentException(
                'It\'s not allowed to set a request body when using multipart/form-data or form parameters.'
            );
        }

        $this->request = $this->request->withBody(Psr7\stream_for($string));

        return $this;
    }
public function setRequestBody ( $ string ) { if ( ! empty ( $ this -> requestOptions [ 'multipart' ] ) || ! empty ( $ this -> requestOptions [ 'form_params' ] ) ) { throw new InvalidArgumentException ( 'It\'s not allowed to set a request body when using multipart/form-data or form parameters.' ) ; } $ this -> request = $ this -> request -> withBody ( Psr7 \ stream_for ( $ string ) ) ; return $ this ; }
Set the request body to a string

@param resource|string|PyStringNode $string The content to set as the request body
@throws InvalidArgumentException If form_params or multipart is used in the request options
an exception will be thrown as these can't be combined.
@return self

@Given the request body is:
Set the request body to a string