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);
    }