How to use CURL / CygWin to send files from a local Windows machine to a server?

My goal is to upload a CouchDB document from my Windows machine to a remote server using cygwin / curl.

Here is a tutorial that shows how to do the same on a Mac: http://net.tutsplus.com/tutorials/getting-started-with-couchdb/

curl -X POST http://127.0.0.1:5984/mycouchshop/ -d @ person.json -H "Content-Type: application / json

How can I do the same with Windows and CygWin?

+5
source share
2 answers

After opening cygwin.

Step 1 - CD into the directory containing the file you want to send via CURL:

cd ../
cd /cygdrive/c/Users/[put user name here]/Documents/[more directories here]/

: "cygdrive".

2. CURL :

curl -X POST http://mywebsite.com/path/to/directory -d @some_file.extension -H "Content-Type: application/json"

"mywebsite.com...", "some_file.extension" "application/json" .

+5

, . Windows (') . JSON, \" JSON.

curl -XPUT http://localhost:5984/db/doc -d "{\"like\": \"this\"}"
+3

All Articles