This address a bug where a `$` character in a request body or header
would not be properly escaped in a string in the generated curl command.
Fixes#5390
* Add empty data param to cURL if no request body was given
Some middleware applications do not allow POST requests without a content-length header. By adding a empty data parameter to the curl command, the content-length header will be set by curl. Besides this it is more obvious to the user that no request body is sent.
* use double quotes like the rest of the curl command
* issue 5040: only append type to formData file if defined
* errant whitespace removal:
* conform to code style
* code style
* use template string in nested type ternary operator
The request body is an immutable.js OrderedMap rather than a string,
so this fixes the type error:
TypeError: request.get(...).split is not a function
Adds a special curl command argument for files, e.g.
curl -F "param=value" -F "file=@filename.txt;type=text/plain"