curl是一個(gè)很棒的命令.
1:get請(qǐng)求
curl http://localhost:9090/api/v1/get/data/?id=10
2:post請(qǐng)求
1): curl ?-d ?'{"id":"10", ?"imagename":"imagename"}' http://localhost:9090/api/v1/update/imagename/
這種方法是參數(shù)直接在header里面的留攒,如需將輸出指定到文件可以通過(guò)重定向進(jìn)行操作
2): curl -H "Content-Type:application/json" -X POST -d '{"id":"10", "test_flag":2, "pre_imagename":"imagename"}' http://localhost:9090/api/v1/update/pre_imagename/
這種方法是json數(shù)據(jù)直接在body里面的揩悄。
其中-d可以用--data參數(shù)來(lái)替換