curl备忘
2017-09-14 本文已影响4人
menglj
- REST POST方法调用
curl -H "Content-Type: application/json" -X POST -d '{"username":"xyz","password":"xyz"}' http://localhost:3000/api/login
-
-His short for--header -
-dfor--data
Note that-X POSTis optional if you use-d, as the-dflag implies a POST request.
- basic认证
curl -u username:password http://localhost:8080/blogs