cURL / Mailing Lists / curl-users / Single Mail

curl-users

corect use of curl

From: John Norris <john_at_norricorp.f9.co.uk>
Date: Fri, 25 Mar 2011 11:52:39 -0000

I am using curl for testing a rest service.
>curl -X PUT -u xxxxx:xxxxxx -H "Content-Type: application/json" -d
'{"param1" : "TS-1", "param2" : "10003"}'
http://localhost:9999/a/b/c/link/TS-3
curl: (6) Could not resolve host: :; Host not found
curl: (6) Could not resolve host: TS-1,; Host not found
curl: (6) Could not resolve host: param2; Host not found
curl: (6) Could not resolve host: :; Host not found
<html><head><title>Apache Tomcat/6.0.20 - Error report</title><style><!--H1
{fon
t-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-s
ize:
22px;} H2
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525
D76;font-size:16px;} H3
{font-family:Tahoma,Arial,sans-serif;color:white;backgro
und-color:#525D76;font-size:14px;} BODY
{font-family:Tahoma,Arial,sans-serif;col
or:black;background-color:white;} B
{font-family:Tahoma,Arial,sans-serif;color:w
hite;background-color:#525D76;} P
{font-family:Tahoma,Arial,sans-serif;backgroun
d:white;color:black;font-size:12px;}A {color : black;}A.name {color :
black;}HR
{color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - </h1><HR
size="
1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b>
<u></u></
p><p><b>description</b> <u>The requested resource () is not
available.</u></p><H
R size="1" noshade="noshade"><h3>Apache Tomcat/6.0.20</h3></body></html>
>
Now I have successfully used curl like this
curl -X PUT -u xxxxx:xxxxx
"http://localhost:9999/a/b/c/link/TS-3?param1=TS-1&param2=10003"

A few questions. Does curl translate the first format into the second format
(possibly not or it would work))
Also, looking at the logs, despite the host not found statements, it does
get through to my code but 10003 is not seen as a number but then it may be
taking another value as param2.

Regards,

John

-------------------------------------------------------------------
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-25