Search code examples
curlcmdgetcommandprompt

Using cURL to view contents of file


I am trying to figure out the command to display the contents of a file (text file) in command prompt using cURL and get. I had the right command but now I can't seem to get the correct syntax right to display the proper file information:

curl -g host:port@path to file curl -d filename-g host:port

I have tried many variations of the above and have consulted the cURL manual:

https://curl.haxx.se/docs/manpage.html

And other SO resources...Just need a little boost here as I had the correct syntax but now have spent several hours trying to get the proper terminology.


Solution

  • I use ...

    curl http://example.com/file
    

    Or eventually

     curl http://example.com:8888/file