GET 传参方式
1. 直接在 URL 中附加参数
curl "http://example.com/api?name=John&age=30"
2. 使用 -G
参数配合 -d
curl -G http://example.com/api \ -d "name=John" \ -d "age=30"
3. 特殊字符处理(自动编码)
curl -G "http://example.com/search" \ --data-urlencode "q=openai & gpt-4"
2024年12月10日大约 11 分钟