Upload file multipart

Multipart form-data upload with extra fields

curl -F 'file=@./report.pdf' -F 'user=alice' https://upload.example.com/api

tool
curl21 commands
tags
curl

More curl commands

  • curl --http2 -sI https://example.com | grep -i 'http\|alt-svc'

    Force HTTP/2 and check protocol in response

  • curl --resolve example.com:443:1.2.3.4 https://example.com

    Override DNS for a host:port pair (test behind CDN/LB)

  • curl --retry 5 --retry-delay 2 --retry-all-errors https://api.example.com/healthz

    Retry up to 5 times with 2s delay on any error

  • curl -d 'user=alice&pass=secret' -X POST https://auth.example.com/login

    Send URL-encoded form data

  • curl --cert client.crt --key client.key --cacert ca.crt https://secure.example.com

    mTLS request with client cert and custom CA

all 21 curl commands