I just realized, due to an error on my part, that though wget manual only mentions URL at the end, I am able to specify body-data option after the URL. This is quite convenient, but I am wondering if this is behavior as designed.
$ wget --method=PUT -O - http://httpbin.org/put --body-data='abcdefg'
--2019-03-27 10:52:30-- http://httpbin.org/put
Resolving httpbin.org (httpbin.org)... 3.85.154.144, 52.71.234.219
Connecting to httpbin.org (httpbin.org)|3.85.154.144|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 415 [application/json]
Saving to: ‘STDOUT’
- 0%[ ] 0 --.-KB/s {
"args": {},
"data": "",
"files": {},
"form": {
"abcdefg": ""
},
"headers": {
"Accept": "*/*",
"Accept-Encoding": "identity",
"Content-Length": "7",
"Content-Type": "application/x-www-form-urlencoded",
"Host": "httpbin.org",
"User-Agent": "Wget/1.19.1 (cygwin)"
},
"json": null,
"origin": "50.203.83.51, 50.203.83.51",
"url": "https://httpbin.org/put"
}
- 100%[==============================================>] 415 --.-KB/s in 0s
2019-03-27 10:52:30 (4.53 MB/s) - written to stdout [415/415]
curl
has a named parameter--url/-u
to allow specifying URL anywhere on command line