api - How to post JSON data using curl over basic http auth? -


i want post data using curl unix command got googling doing below:

curl --dump-header - -h "content-type: application/json"  -x post --data '{"description": "this prbbly lst post.", "transaction_id": "2011-05-22t00:46:38", "account": "another-post"}' http://127.0.0.1:8000/api/transaction/ 

but returning following response header below:

curl: (6) not resolve host: post; nodename nor servname provided, or not known http/1.0 401 unauthorized date: sat, 09 jun 2012 18:50:37 gmt server: wsgiserver/0.1 python/2.7.1 content-type: text/html; charset=utf-8 

what doing wrong

you don't need write "post" make curl(1) post - automatically if give --data argument.

instead, mistaking "post" url want send to, , failing might imagine. drop word , should good.


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -