Mi problema: Usar la herramienta de línea de comandos para curl mi servidor localhost mientras envío algunos datos junto con mi solicitud POST no está funcionando.cURL POST línea de comando en WINDOWS servicio RESTful
Lo que parece ser la causa del error: imaginar algo como esto
curl -i -X POST -H 'Content-Type: application/json' -d '{"data1": "data goes here", "data2": "data2 goes here"}' http:localhost/path/to/api
resultado de los datos que regresan
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
Después de buscar información me di cuenta ese problema no podría ser el sintax utilizado para t lo solicita ya que funciona en shells de UNIX.
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. http://curl.haxx.se/mail/archive-2011-03/0066.html
Me trataron de evitar con los "escapar de ella \", pero aún no funcionaba
2.
curl -i -X POST -H 'Content-Type: application/json' -d '{\"data1\": \"data goes here\", \"data2\": \"data2 goes here\"}' http: //localhost/path/to/api
3.
curl -i -X POST -H 'Content-Type: application/json' -d '{\"data1\": \"data goes here\", \"data2\": \"data2 goes here\"}' http: //localhost/path/to/api
Así i Renunció. Windows parece a echar a perder con el objeto JSON enviado en la POST
No agregue '[resuelto]' al título de su pregunta. Si ha encontrado la respuesta a su pregunta, debe publicarla como respuesta. –
Gracias por la advertencia @CodyGray. Corregiré mi publicación. – Lothre1
Si tienes instalado git en tu máquina, puedes usar git bash para curl. Ahorra muchos dolores de cabeza. –