使用curl命令发送POST或者GET请求
- get:
curl http://127.0.0.1/news?id=1&catid=2
curl --location --request GET 'http://127.0.0.1:8080/file/show?fileId=3a73a271ae972f34f28ea35fb4f05a19' \
--header 'Authorization: Bearer 81940ce4-69cf-46b7-bc7e-98185546e78c'
1
2
3
4
2
3
4
- post(-d 可以通过data来记忆)
curl -d "username=admin&passwd=123456" http://127.0.0.1/user/login
curl --location --request POST 'http://127.0.0.1:8080/app/usr/login'
--header 'Content-Type: application/x-www-form-urlencoded'
--data-urlencode 'name=1'
--data-urlencode 'age=2'
curl --location --request POST 'http://127.0.0.1:8080/app/upload'
--header 'Authorization: Bearer 440c9fc9-edb7-4dc0-ad27-bde726ff8a85'
--form 'file=@"/C:/Users/admin/Desktop/aaahhh.png"'
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
上次更新: 2024/01/07, 07:44:52