-2

How to upload a document from a unix box to an HTTP? Preferably using wget(not curl)

SIDcse
  • 1
  • have look here, i guess its what you are searching for: https://superuser.com/questions/86043/linux-command-line-tool-for-uploading-files-over-http-as-multipart-form-data – YingYang Jun 06 '18 at 07:13

1 Answers1

0

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.

Basile Starynkevitch
  • 223,805
  • 18
  • 296
  • 547