Upload a file as multipart
Upload a file as multipart/form-data with extra form fields.
curl -F 'file=@./report.pdf' -F 'user=alice' https://upload.example.com/api
More curl commands
-
curl --http2 -sI https://example.com | grep -i 'http\|alt-svc'Ask for HTTP/2 and check the protocol and alt-svc in the response headers.
-
curl --resolve example.com:443:1.2.3.4 https://example.comSend the request to a chosen IP for a host:port pair. Handy for testing a server behind a CDN or load balancer.
-
curl --retry 5 --retry-delay 2 --retry-all-errors https://api.example.com/healthzRetry up to 5 times, 2 seconds apart, on any error.
-
curl -d 'user=alice&pass=secret' -X POST https://auth.example.com/loginSend form data in URL-encoded format.
-
curl --cert client.crt --key client.key --cacert ca.crt https://secure.example.comMake an mTLS request with a client certificate and your own CA.