cURL / Mailing Lists / curl-users / Single Mail

curl-users

Require syntax to put/post file to apache tomact server 6.0

From: Dattaprasanna Singbal <DS0036943_at_techmahindra.com>
Date: Wed, 23 Mar 2011 00:19:19 +0530

I am trying to write data from a .txt file to an apache tomcat server 6.0 residing on my own machine with the following command on Win XP machine from command prompt. (I wish to write contents of file1.txt, situated at "curl-7.21.4-devel-mingw32\bin" to root folder of tomcat 6.0 at file2.txt.)
 
For POST command
-----------------------------
"\curl-7.21.4-devel-mingw32\bin>curl -d @file1.txt http://localhost:8080/file2.txt"
 
I only end up getting the following message "Warning: Couldn't read data from file "file1.txt", this makes an empty POST.<html><head><title>Apache Tomcat/6.0.32 - Error report</title><style><!--H1 {fon ----
----------- ------------------- ------------------------------ --------------------- ----------------------- .."
 
For PUT command
---------------------------
"\curl-7.21.4-devel-mingw32\bin>curl -X -d @file1.txt http://localhost:8080/file2.txt"
 
I get the message
    curl: (6) Could not resolve host: file1.txt; Host not found
 
Can anyone help me out with the syntax ?

============================================================================================================================Disclaimer: This message and the information contained herein is proprietary and confidential and subject to the Tech Mahindra policy statement, you may review the policy at http://www.techmahindra.com/Disclaimer.html externally and http://tim.techmahindra.com/Disclaimer.html internally within Tech Mahindra.============================================================================================================================

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-03-22