新學到一個小技巧,在命令行中模擬get、post請求
模擬post請求
模擬post請求,在命令行中輸入:-d代表post請求
curl -d '[參數]' [請求地址]
eg: curl -d 'name=bob&age=27' http://localhost:30000/users/add
模擬get請求
curl [請求地址?參數=參數值&參數=參數值...]
eg: curl http://localhost:30000/users/add
新學到一個小技巧,在命令行中模擬get、post請求
模擬post請求,在命令行中輸入:-d代表post請求
curl -d '[參數]' [請求地址]
eg: curl -d 'name=bob&age=27' http://localhost:30000/users/add
curl [請求地址?參數=參數值&參數=參數值...]
eg: curl http://localhost:30000/users/add