-d
or -F
.<form>
tag is what makes one of those appear on the web page. The tag instructs the browser how to format its POST. If the form tag includes enctype=multipart/form-data
, it tells the browser to send the data as a multipart formpost which you make with curl's -F
option. This method is typically used when the form includes a <input type=file>
tag, for file uploads.enctype
used by forms, which is rarely spelled out in HTML since it is default, is application/x-www-form-urlencoded
. It makes the browser "URL encode" the input as name=value pairs with the data encoded to avoid unsafe characters. We often refer to that as a regular POST, and you perform one with curl's -d
and friends.-d
option does not alter or encode the data at all but will just send exactly what you tell it to. Just pay attention that -d
sets a default Content-Type:
that might not be what you want.