How to upload a document from a unix box to an HTTP? Preferably using wget(not curl)
1 Answers
Reason in terms of the HTTP protocol and HTTP requests. Yo probably want to do some HTTP POST
request (in rare cases, it might be a PUT
request). You need to understand precisely which request should be done (and with which HTTP cookies!). If some HTML form is involved, you need to identify and understand what HTTP request is it doing, so read more about <input
elements in HTML (some of them might be of <input type='hidden'
). See also this about application/x-www-form-urlencoded
POST data.
Then you need an HTTP client capable of issuing such a request. GNU wget can't do POST
(unless you use some --post
* options), only GET
. But curl
can do both.
You could also write some script or program doing that request. Using some HTTP client library (like libcurl) is helpful.

- 223,805
- 18
- 296
- 547