private function getRequestBody(array $parameters, array $files)
    {
        $body = array();
        foreach ($parameters as $parameterName => $parameterValue) {
            if (is_scalar($parameterValue) || (is_null($parameterValue) && $parameterName !== 'id')) {
                $body[] = array(
                    'name' => $parameterName,
                    'contents' => strval($parameterValue),
                );
            }
        }

        foreach ($files as $parameterName => $fileResource) {
            if (is_resource($fileResource)) {
                $metaData = stream_get_meta_data($fileResource);

                $body[] = array(
                    'name' => $parameterName,
                    'contents' => $fileResource,
                    'filename' => basename($metaData['uri']),
                );
            }
        }

        return new MultipartStream($body);
    }
private function getRequestBody(array $parameters, array $files)
    {
        $body = array();
        foreach ($parameters as $parameterName => $parameterValue) {
            if (is_scalar($parameterValue) || (is_null($parameterValue) && $parameterName !== 'id')) {
                $body[] = array(
                    'name' => $parameterName,
                    'contents' => strval($parameterValue),
                );
            }
        }

        foreach ($files as $parameterName => $fileResource) {
            if (is_resource($fileResource)) {
                $metaData = stream_get_meta_data($fileResource);

                $body[] = array(
                    'name' => $parameterName,
                    'contents' => $fileResource,
                    'filename' => basename($metaData['uri']),
                );
            }
        }

        return new MultipartStream($body);
    }
private function getRequestBody ( array $ parameters , array $ files ) { $ body = array ( ) ; foreach ( $ parameters as $ parameterName => $ parameterValue ) { if ( is_scalar ( $ parameterValue ) || ( is_null ( $ parameterValue ) && $ parameterName !== 'id' ) ) { $ body [ ] = array ( 'name' => $ parameterName , 'contents' => strval ( $ parameterValue ) , ) ; } } foreach ( $ files as $ parameterName => $ fileResource ) { if ( is_resource ( $ fileResource ) ) { $ metaData = stream_get_meta_data ( $ fileResource ) ; $ body [ ] = array ( 'name' => $ parameterName , 'contents' => $ fileResource , 'filename' => basename ( $ metaData [ 'uri' ] ) , ) ; } } return new MultipartStream ( $ body ) ; }
Returns the multipart request body with the parameters and files.

@param array $parameters
@param array $files

@return MultipartStream
Returns the multipart request body with the parameters and files .