% curl, http # GET 请求示例: curl # POST 请求示例:curl -X POST -d "username=user&password=pass" http://example.com/login curl -X POST -d "" # JSON 请求示例:curl -H "Content-Type: application/json" -d '{"name": "John", "age": 30}' http://example.com/data curl -H "Content-Type: application/json" -d '' # 文件上传示例: curl -F "file=@" # 下载shell并立即执行 curl -sSL | sh # 下载文件 curl -O # send a get http request curl # send a http request curl -X # send a http request and write the output to a file curl -X -o # send a get http request and follow redirects curl -L # send a get http request exit with a non-zero status code on failure curl --fail # send an authenticated http request curl -u : -X # send a http request with a json body curl -X -H 'Content-Type: application/json' -d '' # send a http request with a form body curl -d = # send a http request and see the request as well as the response curl -v # send a http request with a body from a file curl -X --data-binary "@" # send a http request with a custom header curl -X -H ": " $ file: ls $ method: echo -e 'GET\nPOST\nPUT\nDELETE\nPATCH'