linux - How to post JSON data using lynx command line? -
i able post json using curl below , able json output
curl -x post -h content-type:application/json -d '{"xyz":"abc"} http://mymachine.com/test.jsp
output -
{"sucess":"pqr"}
but in stage box dont have curl trying same using lynx
i tried below
echo -e '{"xyz":"abc"}\n---\n' | lynx -head 'content-type: application/json' -post_data http://mymachine.com/test.jsp
above command not working, getting output {"error":"pqr"} come when test service didnt receive output.
can please let me know might issue here?
if @ lynx man page, you'll see -head
sending head
requests, doesn't set http header request.
there no option listed in man page set request header, content type post
requests application/x-www-form-urlencoded
.
you'll have find tool job, try if useful installed (wget
, nc
, ncat
, bash
, ...).
if tell me what's available, can give concrete example.
Comments
Post a Comment