Note that there are some explanatory texts on larger screens.

plurals
  1. POcURL POST command line on WINDOWS RESTful service
    primarykey
    data
    text
    <p><strong>My problem:</strong> Using the command line tool to curl my localhost server while sending some data along with my POST request is not working.</p> <p><strong>What seems to be causing the error:</strong> Imagine something like this</p> <ol> <li><code>curl -i -X POST -H 'Content-Type: application/json' -d '{"data1": "data goes here", "data2": "data2 goes here"}' http:localhost/path/to/api</code></li> </ol> <p>Result of the returning data</p> <pre><code>curl: (6) Could not resolve host: application; No data record of requested type curl: (6) Could not resolve host: data goes here,; No data record of requested type curl: (6) Could not resolve host: data2; No data record of requested type curl: (3) [globbing] unmatched close brace/bracket at pos 16 </code></pre> <p>After some searching i figured out that problem couldn't be the sintax used for the request since it works on UNIX shells. </p> <blockquote> <p>Are you possibly using Windows? That so looks like a completely broken shell that doesn't properly deal with single-quotes vs double-quotes. I just tried that command line and it worked fine on my linux box. <a href="http://curl.haxx.se/mail/archive-2011-03/0066.html" rel="nofollow noreferrer">http://curl.haxx.se/mail/archive-2011-03/0066.html</a></p> </blockquote> <p>I tried to work around with those " escaping it \" but it still didn't work</p> <p>2.</p> <blockquote> <p>curl -i -X POST -H 'Content-Type: application/json' -d '{\"data1\": \"data goes here\", \"data2\": \"data2 goes here\"}' http: //localhost/path/to/api</p> </blockquote> <p>3.</p> <blockquote> <p>curl -i -X POST -H 'Content-Type: application/json' -d '{\"data1\": \"data goes here\", \"data2\": \"data2 goes here\"}' http: //localhost/path/to/api</p> </blockquote> <p>So i gave up. Windows seems to messing up with the JSON object sent on POST</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload