error in POST request with cURL on Windows
<p>I am trying to send a POST request to my localhost using cURL on my Windows 10. I am using Ruby on Rails and my database is PostgresQL. I tried all the solutions posted on everywhere but none of them is working.</p>

<p>This is what a type into cURL:</p>

<p><code>curl -v -g -H "Accept: application/json" -H "Content-type: application/json" -H "Authorization: NVNNymcrAExBdDsaje9z" -X POST http://localhost:3000/users/reservations -d '{"reservation": {"venue":"new Venue", "venue_id":"1", "reservation_date":"2016/04/26", "num_people":"3", "num_bottles":"1"}}'</code></p>

<p>This is the error I am getting:</p>

<pre><code>    Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying ::1...
*   Trying 127.0.0.1...
* connect to ::1 port 3000 failed: Connection refused
* connect to 127.0.0.1 port 3000 failed: Connection refused
* Failed to connect to localhost port 3000: Connection refused
* Closing connection 0
curl: (7) Failed to connect to localhost port 3000: Connection refused
Note: Unnecessary use of -X or --request, POST is already inferred.
* Rebuilt URL to: {venue:new Venue,/
* Could not resolve host: {venue
* Closing connection 1
curl: (6) Could not resolve host: {venue
Note: Unnecessary use of -X or --request, POST is already inferred.
* Rebuilt URL to: venue_id:1,/
* Could not resolve host: venue_id
* Closing connection 2
curl: (6) Could not resolve host: venue_id
Note: Unnecessary use of -X or --request, POST is already inferred.
* Could not resolve host: reservation_date
* Closing connection 3
curl: (6) Could not resolve host: reservation_date
Note: Unnecessary use of -X or --request, POST is already inferred.
* Rebuilt URL to: num_people:3,/
* Could not resolve host: num_people
* Closing connection 4
curl: (6) Could not resolve host: num_people
Note: Unnecessary use of -X or --request, POST is already inferred.
* Rebuilt URL to: num_bottles:1}}'/
* Could not resolve host: num_bottles
* Closing connection 5
curl: (6) Could not resolve host: num_bottles
</code></pre>

<p>I tried using escape quotes like this:</p>

<pre><code>curl -v -g -H "Accept: application/json" -H "Content-type: application/json" -H "Authorization: NVNNymcrAExBdDsaje9z" -X POST http://localhost:3000/users/reservations/ -d {\"reservation\": {\"venue\":\"new Venue\", \"venue_id\":\"1\", \"reservation_date\":\"2016/04/26\", \"num_people\":\"3\", \"num_bottles\":\"1\"}}
</code></pre>

<p>This is the error I get with the escape quotes:</p>

<pre><code>    Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying ::1...
*   Trying 127.0.0.1...
* connect to ::1 port 3000 failed: Connection refused
* connect to 127.0.0.1 port 3000 failed: Connection refused
* Failed to connect to localhost port 3000: Connection refused
* Closing connection 0
curl: (7) Failed to connect to localhost port 3000: Connection refused
Note: Unnecessary use of -X or --request, POST is already inferred.
* Rebuilt URL to: {"venue":"new/
* Could not resolve host: {"venue"
* Closing connection 1
curl: (6) Could not resolve host: {"venue"
Note: Unnecessary use of -X or --request, POST is already inferred.
* Rebuilt URL to: Venue",/
* Could not resolve host: Venue",
* Closing connection 2
curl: (6) Could not resolve host: Venue",
Note: Unnecessary use of -X or --request, POST is already inferred.
* Rebuilt URL to: "venue_id":"1",/
* Could not resolve host: "venue_id"
* Closing connection 3
curl: (6) Could not resolve host: "venue_id"
Note: Unnecessary use of -X or --request, POST is already inferred.
* Could not resolve host: "reservation_date"
* Closing connection 4
curl: (6) Could not resolve host: "reservation_date"
Note: Unnecessary use of -X or --request, POST is already inferred.
* Rebuilt URL to: "num_people":"3",/
* Could not resolve host: "num_people"
* Closing connection 5
curl: (6) Could not resolve host: "num_people"
Note: Unnecessary use of -X or --request, POST is already inferred.
* Rebuilt URL to: "num_bottles":"1"}}/
* Could not resolve host: "num_bottles"
* Closing connection 6
curl: (6) Could not resolve host: "num_bottles"
</code></pre>

<p>I also tried moving my data files inside the curl/bin and use -d @text.txt like this:</p>

<pre><code>curl -v -g -H "Accept: application/json" -H "Content-type: application/json" -H "Authorization: NVNNymcrAExBdDsaje9z" -X POST http://localhost:3000/users/reservations -d @text.txt
</code></pre>

<p>This is the error:</p>

<pre><code>    Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying ::1...
*   Trying 127.0.0.1...
* connect to ::1 port 3000 failed: Connection refused
* connect to 127.0.0.1 port 3000 failed: Connection refused
* Failed to connect to localhost port 3000: Connection refused
* Closing connection 0
curl: (7) Failed to connect to localhost port 3000: Connection refused
</code></pre>

<p>I am open to any suggestions? What do you think my problem is? How do I fix this and make a proper POST request?</p>