Curl
2017-12-21 19:54:14
Documentation
What's curl used for? curl is used in command lines or scripts to transfer data. curl is also used in cars, television sets, routers, printers, audio equipment, mobile phones, tablets, settop boxes, media players and is the Internet transfer engine for thousands of software applications in over ten billion installations. https://curl.se/
Request
curl -v -X OPTIONS 192.168.0.102
\* Trying 192.168.0.102...
\* Connected to 192.168.0.102 (192.168.0.102) port 80 (#0)
> OPTIONS / HTTP/1.1
> Host: 192.168.0.102
> User-Agent: curl/7.47.0
> Accept: \*/\*
Response
< HTTP/1.1 200 OK
< Allow: PROPFIND, DELETE, MKCOL, PUT, MOVE, COPY, PROPPATCH, LOCK, UNLOCK
< Allow: OPTIONS, GET, HEAD, POST
< Content-Length: 0
< Date: Thu, 21 Dec 2017 00:32:04 GMT
< Server: lighttpd/1.4.28
in the response we can see that list of Allowed method is quite long "PROPFIND, DELETE, MKCOL, PUT, MOVE, COPY, PROPPATCH, LOCK, UNLOCK" What we can do ?
Upload file
curl --upload-file php-echo.txt -v --url http://192.168.0.105/php-echo.php -0 --http1.0
Remove file
curl -i -X DELETE 192.168.0.102/php-echo.php