Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Choose the upload format your endpoint requires first, then choose the HTTP version. Use --upload-file (or -T) when the server documents a direct PUT upload; use --form (or -F) when it expects multipart/form-data. Over HTTPS, try HTTP/2 with --http2 when your curl build supports it, but keep --http1.1 as a compatibility fallback.

HTTP/2 can improve connection reuse and concurrent transfers, but there is no authoritative universal percentage showing that a single large upload is faster. Body size, congestion control, flow-control windows, disk and application processing, and proxies usually matter more than the protocol label. Measure the actual endpoint and network path before changing production defaults.

What you are actually choosing

Two independent decisions are often confused in curl upload commands:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • HTTP version: HTTP/2 or HTTP/1.1 controls framing, stream multiplexing, header handling, and connection behavior.
  • Request-body representation: a direct PUT body or a multipart/form-data form controls how the server receives the file and its metadata.

HTTP/2 keeps HTTP semantics while changing how messages travel over a connection. RFC 7540 describes an optimized mapping of HTTP semantics to an underlying connection, adding binary framing, interleaved streams, header compression, and prioritization. It does not turn a PUT into a form upload, and it does not make an endpoint that only accepts multipart data accept a raw file body.

#1 Best Overall
Sale
TP-Link USB to Ethernet Adapter,Support Nintendo Switch,1Gbps,Plug and Play | Gigabit RJ45 to USB A 3.0 Network Adapter, Foldable & Portable Design, Compatible w/ Windows, macOS, & Linux(UE306)
  • 𝐇𝐢𝐠𝐡-𝐒𝐩𝐞𝐞𝐝 𝐔𝐒𝐁 𝐄𝐭𝐡𝐞𝐫𝐧𝐞𝐭 𝐀𝐝𝐚𝐩𝐭𝐞𝐫 - UE306 is a USB 3.0 Type-A to RJ45 Ethernet adapter that adds a reliable wired network port to your laptop, tablet, or Ultrabook. It delivers fast and stable 10/100/1000 Mbps wired connections to your computer or tablet via a router or network switch, making it ideal for file transfers, HD video streaming, online gaming, and video conferencing.
  • 𝐔𝐒𝐁 𝟑.𝟎 𝐟𝐨𝐫 𝐅𝐚𝐬𝐭𝐞𝐫, 𝐌𝐨𝐫𝐞 𝐒𝐭𝐚𝐛𝐥𝐞 𝐃𝐚𝐭𝐚 𝐓𝐫𝐚𝐧𝐬𝐟𝐞𝐫𝐬- Powered via USB 3.0, this adapter provides high-speed Gigabit Ethernet without the need for external power(10/100/1000Mbps). Backward compatible with USB 2.0/1.1, it ensures reliable performance across a wide range of devices.
  • 𝐒𝐮𝐩𝐩𝐨𝐫𝐭𝐬 𝐍𝐢𝐧𝐭𝐞𝐧𝐝𝐨 𝐒𝐰𝐢𝐭𝐜𝐡- Easily connect your Nintendo Switch to a wired network for faster downloads and a more stable online gaming experience compared to Wi-Fi.
  • 𝐏𝐥𝐮𝐠 𝐚𝐧𝐝 𝐏𝐥𝐚𝐲- No driver required for Nintendo Switch, Windows 11/10/8.1/8, and Linux. Simply connect and enjoy instant wired internet access without complicated setup.
  • 𝐁𝐫𝐨𝐚𝐝 𝐃𝐞𝐯𝐢𝐜𝐞 𝐂𝐨𝐦𝐩𝐚𝐭𝐢𝐛𝐢𝐥𝐢𝐭𝐲- Supports Nintendo Switch, PCs, laptops, Ultrabooks, tablets, and other USB-powered web devices; works with network equipment including modems, routers, and switches.

Start by reading the API or server contract. It should tell you the method, URL shape, field name, authentication method, content type, destination naming rules, and whether an existing object is replaced. If those details are missing, a protocol switch cannot compensate for an undefined upload contract.

Decide between --upload-file and --form

Direct PUT with --upload-file

Use this form when the endpoint accepts the file as the complete request body:

curl --upload-file ./archive.zip https://example.example/upload

The short option is -T. For HTTP(S) URLs, curl sends a PUT request. If the URL does not specify a remote filename, curl appends the local filename, subject to the trailing-slash behavior documented in the curl manual. A server-side program must explicitly accept PUT and define authorization, destination naming, overwrite behavior, and content-type expectations.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

This representation is a good fit for object-storage-style APIs, WebDAV-like endpoints, and APIs that identify the target object in the URL. It is not interchangeable with a browser-style form. A server expecting a field called file in a multipart body may reject a raw PUT even though the bytes are identical.

Multipart form with --form

Use this form when the endpoint is modeled on an HTML file form or API documentation specifies multipart/form-data:

curl --form 'file=@./archive.zip' https://example.example/upload

The short option is -F. curl creates the multipart boundaries and sends the file in the named file part. Add more fields when the API requires metadata:

curl --form 'file=@./archive.zip' 
     --form 'description=nightly backup' 
     --form 'retention_days=30' 
     https://example.example/upload

Use the field name specified by the server; file is only an example. Authentication headers, an API-specific URL, and an explicit content type may also be required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why the options cannot be mixed

--form is mutually exclusive with --data and --upload-file. They describe different body encodings, not alternate spellings for the same operation. Combining them as though they were additive can produce a client-side error or a request the server cannot parse.

Rank #2
Amazon Basics USB 3.0 to 10/100/1000 Gigabit Ethernet Internet Adapter, Compatible with Windows and macOS, Black
  • Connects a USB 3.0 device (computer/laptop) to a router, modem, or network switch to deliver Gigabit Ethernet to your network connection. Does not support Smart TV or gaming consoles (e.g.Nintendo Switch).
  • Supported features include Wake-on-LAN function, Green Ethernet & IEEE 802.3az-2010 (Energy Efficient Ethernet)
  • Supports IPv4/IPv6 pack Checksum Offload Engine (COE) to reduce Cental Processing Unit (CPU) loading
  • Compatible with Windows 8.1 or higher, Mac OS

Ordinary URL-encoded form fields use --data, not --form. If a file is one field among several, use multipart. If the file is the entire body, use the PUT contract.

Protect literal form values with --form-string

When a form value comes from a user or another untrusted source, use --form-string for a literal value:

curl --form 'file=@./archive.zip' 
     --form-string 'description=@not-a-filename' 
     https://example.example/upload

With --form, a leading @ can be interpreted as a local filename and a leading < can trigger file reading. The curl tutorial warns that using -F instead of --form-string in this situation could allow a value to trick curl into uploading a file. Validate filenames, paths, and metadata before constructing a command.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How curl negotiates HTTP/2

Check the local build first

HTTP/2 support depends on how libcurl was built. Run:

curl --version

Look at the features list. It should include HTTP2. If it does not, --http2 cannot enable HTTP/2; install or invoke a curl build that includes HTTP/2 support.

HTTPS: normal negotiation

For an HTTPS URL, this is the normal starting point:

curl --http2 --upload-file ./archive.zip https://example.example/upload

curl asks libcurl to negotiate HTTP/2 during the TLS handshake. The server and the TLS application-layer protocol negotiation (ALPN) result determine the protocol actually used. The option is therefore a request, not an unconditional mandate: a server can select HTTP/1.1, and a proxy or gateway can affect the result.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

curl does not make --http2 require TLS 1.2 or newer by itself. If your policy sets a minimum TLS version, add it explicitly, for example:

Rank #3
BENFEI USB 3.0 to Ethernet Adapter, USB C to RJ45 Gigabit LAN (1000Mbps) Network Adapter, Compatible with MacBook/Pro/Air, Surface Pro, Windows 11/10/8/7, Mac OS [Aluminium Shell&Nylon Cable]
  • COMPACT DESIGN - The compact-designed portable BENFEI USB A/C to Ethernet adapter connects your computer or tablet to a router,modem or network switch for network connection. It adds a standard RJ45 port to your Ultrabook, notebook or Macbook Air for file transferring, video conferencing, gaming, and HD video streaming.
  • SUPERIOR STABILITY - Built-in advanced IC chip works as the bridge between RJ45 Ethernet cable and your USB A/C devices. The driver-free installation with native driver support in Chrome, Mac, and Windows OS; The USB A/C Ethernet adapter dongle supports important performance features including Wake-on-Lan (WoL), Full-Duplex (FDX) and Half-Duplex (HDX) Ethernet, Crossover Detection, Backpressure Routing, Auto-Correction (Auto MDIX).
  • INCREDIBLE PERFORMANCE - Supports full 10/100/1000Mbps gigabit ethernet performance over USB A/C's 5Gbps bus, faster and more reliable than most wireless connections. Link and Activity LEDs. USB powered, no external power required. Backward compatible with USB 2.0/1.1.✅ To reach 1Gbps, make sure to use CAT6 & up Ethernet cables.
  • BROAD COMPATIBILITY - The USB A/C-Ethernet adapter is compatible with Windows 11/10/8.1/8/7/Vista/XP, Mac OSX 10.6/10.7/10.8/10.9/10.10/10.11/10.12, Linux kernel 3.x/2.6, Android and Chrome OS.Compatible with IEEE 802.3, IEEE 802.3u and IEEE 802.3ab. Supports IEEE 802.3az (Energy Efficient Ethernet).❌Do Not Support Windows RT. (NOT compatible with Nintendo Switch.)
  • 18 MONTH WARRANTY - Exclusive BENFEI Unconditional 18-month Warranty ensures long-time satisfaction of your purchase; Friendly and easy-to-reach customer service to solve your problems timely.
curl --http2 --tlsv1.2 
     --upload-file ./archive.zip 
     https://example.example/upload

Use the TLS option only to enforce a policy you actually need. Do not disable certificate verification to work around a negotiation failure.

HTTP URLs: Upgrade and prior knowledge

For cleartext HTTP, --http2 attempts an HTTP/1.1 Upgrade exchange. This allows the server to indicate whether it will continue with HTTP/2. --http2-prior-knowledge skips that exchange and starts with HTTP/2 framing immediately, so use it only when the server is documented or otherwise known to accept direct cleartext h2:

curl --http2-prior-knowledge 
     --upload-file ./archive.zip 
     http://example.example/upload

Prior knowledge is not a general speed switch. On an unknown endpoint it can fail before the application receives a request.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Force HTTP/1.1 when compatibility requires it

To force HTTP/1.1, use:

curl --http1.1 --upload-file ./archive.zip https://example.example/upload

This is useful when a proxy, load balancer, origin server, security appliance, or older HTTP implementation has a known HTTP/2 interoperability problem. Record the reason for the exception so that a future infrastructure change does not leave an unexplained downgrade in place.

Verify what happened instead of assuming

Seeing --http2 in a script does not prove that the request used HTTP/2. Inspect the exchange while testing:

curl --http2 -v 
     --upload-file ./archive.zip 
     https://example.example/upload

Verbose output shows TLS negotiation and request details. For repeatable diagnostics, use a trace file:

curl --http2 --trace-time --trace-ascii upload.trace 
     --upload-file ./archive.zip 
     https://example.example/upload

Check the negotiated protocol indication, the response status, and any intermediary-generated headers. A successful HTTP/1.1 response after an HTTP/2 request is a negotiation outcome, not a curl malfunction. Avoid placing secrets in trace files; protect or delete them after troubleshooting.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Record at least:

  • the curl and libcurl versions and whether the build advertises HTTP/2;
  • the URL, method, body representation, and authentication mode;
  • the negotiated protocol and response status;
  • file size, elapsed time, and whether a proxy or gateway was in the path;
  • timeouts, retries, and any server-side request identifier.

Does HTTP/2 make a single large upload faster?

There is no general curl benchmark in the authoritative material that supports a statement such as “HTTP/2 is X percent faster” for file uploads. A large upload spends most of its time transmitting the request body. Its result depends on network congestion control, round-trip latency, server and client flow-control windows, disk-read speed, TLS processing, proxy buffering, and the receiver’s application pipeline.

Rank #4
Sale
Anker USB C to Ethernet Adapter, Portable 1 Gbps Network Hub | Aluminum, Compact, 10/100/1000Mbps, for MacBook Pro, iPad Pro, ChromeBook, XPS, Galaxy and More
  • The Anker Advantage: Join the 65 million+ powered by our leading technology.
  • Instant Internet: Connect to the internet instantly from virtually any USB-C 3.0 device, and enjoy stable connection speeds of up to 1 Gbps.
  • Lightweight and Compact: The space-saving and portable design measures just over half an inch thick and weighs about the same as a AA battery.
  • Premium Build: Features a sleek aluminum exterior and braided-nylon cable to complement the design of high-end devices.
  • What You Get: PowerExpand USB-C to Gigabit Ethernet Adapter, welcome guide, 18-month worry-free warranty, and friendly customer service.

HTTP/2 can still help in specific workloads:

  • Several uploads or API calls at once: multiplexed streams can share one connection instead of requiring multiple HTTP/1.1 connections.
  • Repeated requests with headers: HPACK compression can reduce repetitive header bytes.
  • High-latency paths: interleaving streams can avoid some connection-level waiting that would otherwise delay unrelated requests.
  • Connection reuse: one established TLS connection can carry multiple streams when the endpoint and intermediary permit it.

Those mechanisms do not guarantee a higher throughput for one stream. HTTP/2 flow control, server scheduling, proxy behavior, or an implementation defect can make results equal to or worse than HTTP/1.1. Treat protocol selection as an engineering hypothesis and measure it against your endpoint.

A useful test plan

  1. Choose representative files, including the smallest and largest files your application normally sends.
  2. Keep the URL, credentials, request body, and server instance constant.
  3. Run the same test with --http2 and --http1.1; capture the negotiated protocol and status.
  4. Repeat at the concurrency your application uses, not only with one serial request.
  5. Test the real geographic path, latency, proxy chain, and bandwidth limits.
  6. Compare upload throughput, total time, time to first response, error rate, retry behavior, and server resource use.
  7. Repeat enough times to distinguish normal network variation from a protocol effect.

Do not publish a speed percentage from a single run. A result that changes when a gateway, file size, or concurrency level changes is a property of that deployment, not of HTTP/2 in the abstract.

Security: protocol, TLS, and input handling

Prefer HTTPS with certificate verification

HTTP/2 over HTTPS uses ALPN inside TLS to establish that both peers are willing to speak HTTP/2. RFC 7540 explains that this positive indication helps prevent cross-protocol attacks. Production uploads should normally use HTTPS and normal certificate verification.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Cleartext h2c has much weaker protection against cross-protocol attacks and exposes the upload to the risks of an unencrypted connection. Use it only in a controlled environment with a documented threat model; it is not the normal production choice for sensitive files.

Do not weaken verification to solve negotiation errors

Options that disable certificate verification may hide the real cause of a failure and expose file contents or credentials. Troubleshoot the certificate chain, hostname, trust store, proxy interception policy, and server configuration instead. If an organization requires a private certificate authority, configure that trust deliberately rather than disabling checks.

Keep curl and libcurl patched

The curl project’s CVE index lists CVE-2026-92392, “HTTP/2 upload Use-After-Free,” published on 2026-10-14. The listing identifies affected versions as 8.12.0 through 8.22.0. Because advisories and fixed versions can change, verify the current curl advisory and your distribution’s update status before deployment. Do not infer a safe version from the affected range alone when a vendor backport may be involved.

Validate every user-controlled value

  • Use --form-string for literal metadata values.
  • Reject unexpected path separators, control characters, and oversized names before building a command.
  • Keep uploaded files in an intended directory and apply server-side authorization.
  • Do not treat a client-provided filename or content type as proof of file type.
  • Protect command logs and traces because they can contain URLs, headers, metadata, or error details.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Compatibility and failure modes

The server returns a method or media-type error

A 405 Method Not Allowed commonly means the endpoint does not accept PUT. Switch to the documented multipart method rather than changing HTTP versions:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl --form 'file=@./archive.zip' https://example.example/upload

A 400 or 415 Unsupported Media Type often indicates that the body shape or content type is wrong. Confirm the required field name, multipart requirement, JSON metadata format, and any mandatory headers.

Best Value
Sale
Acer USB to Ethernet Adapter, USBC Hub Ethernet 1Gbps with 3*USB 3.0
  • Dual USB-A/C Port Design: This USB hub with ethernet adapter features dual connectors for both USB C and USB A devices, ensuring wide compatibility across laptops, tablets, and smartphones. It includes 1x Gigabit Ethernet port and 3x USB A 3.0 ports, all usable at the same time for smooth and efficient connectivity. 📌Note: When using USB-A to connect devices, please ensure the USB-C is securely attached to the USB-A connector.
  • Stable Gigabit Ethernet Adapter: Get fast, wired Internet up to 1000Mbps with this USB C to ethernet adapter. Backward compatible with 10/100Mbps networks for flexible connectivity across various setups. Ideal for streaming, gaming, and large file transfers. 📌Note: Ensure the RJ45 connector is plugged in securely in the port and use CAT6 & above Ethernet cable is required to reach 1 Gbps.
  • 5Gbps Data Transfer: Transfer large files, photos, and videos in seconds with this USB 3.0 hub supporting speeds up to 5Gbps—10× faster than USB 2.0. Backward compatible with USB 2.0 and 1.1 devices, this USB splitter expands one port into three for connecting keyboards, mice, and flash drives for everyday use. 📌Note: The three USB-A 3.0 ports share a total 5Gbps bandwidth.【NO HDMI port, NO USB-C data port, and NO PD charging】
  • Plug and Play: Reliable USB to ethernet adapter ready to use in seconds. Instantly connects with USB-A and USB-C devices including MacBook Pro/Air, iPad Pro, iMac, Surface Laptops, Chromebook, XPS, tablets, Steam, and smartphones. Works with Windows, macOS, Linux, Chrome OS, and Android. 📌XP/Win7 may need driver. Older systems may not recognize this product due to its USB 3.0 chip. Please refer to the “Installation Manual” to manually download and install the driver.
  • Durable & Portable Build: Made with sturdy aluminum alloy, this RJ45 to USB-C adapter delivers long-term durability, efficient heat dissipation, and stable performance for offices, corporate deployments, classrooms, and campus workstations—while its slim, portable form factor makes it ideal for business travel, educators, and mobile professionals.

HTTP/2 negotiation fails but HTTP/1.1 works

First confirm that curl --version lists HTTP2. Then inspect verbose output for certificate, ALPN, proxy, or connection errors. If the intermediary is the problem, use:

curl --http1.1 --form 'file=@./archive.zip' 
     https://example.example/upload

Keep the downgrade scoped to the affected host or route when possible. If you control the gateway, investigate HTTP/2 support and timeout, buffering, stream, and flow-control settings rather than masking a persistent defect with a global client change.

HTTP/2 prior knowledge fails immediately

Remove --http2-prior-knowledge and try normal negotiation. Prior knowledge is appropriate only for a server known to accept direct h2, particularly on cleartext connections. An unknown server may speak only HTTP/1.1 or require the Upgrade exchange.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The upload stalls or times out

Separate transport and application causes. Check the local file read, available disk space, client and proxy idle timeouts, server request-size limits, reverse-proxy buffering, and application processing time. Compare the same file over HTTP/1.1 and HTTP/2 while preserving all other variables. A protocol change cannot fix a server that rejects the file size or waits indefinitely for metadata.

The request succeeds but the object is named incorrectly

With --upload-file, confirm whether the URL ends in a slash or already contains the desired remote name; curl’s filename-appending behavior depends on that URL. For multipart uploads, check the server’s filename handling and the multipart field name. Set the destination explicitly in the API contract rather than relying on a client-provided name when overwrite or collision behavior matters.

Choosing a default for common deployments

Situation Body option Protocol starting point Reason
API documents a raw file PUT --upload-file --http2 over HTTPS Matches the direct request-body contract while allowing normal negotiation.
API documents an HTML-style file field --form --http2 over HTTPS Creates the required multipart encoding and can carry metadata fields.
Known HTTP/2 defect in a proxy or origin Contract-specific --http1.1 Provides a deliberate compatibility fallback.
Unknown cleartext server Contract-specific Normal HTTP/1.1 or negotiated --http2 Avoids assuming prior knowledge of h2 support.
Documented direct h2 service on cleartext HTTP Contract-specific --http2-prior-knowledge Skips Upgrade only when direct h2 is known to be supported.

“Contract-specific” means that the method and body encoding still come from the endpoint documentation; HTTP version never determines whether the request is PUT or multipart.

A production-ready workflow

  1. Read the endpoint contract. Identify PUT versus multipart, field names, URL naming, authentication, size limits, overwrite rules, and required metadata.
  2. Use HTTPS. Keep certificate and hostname verification enabled, and apply your organization’s TLS minimum explicitly if required.
  3. Check curl capabilities. Confirm the installed build lists HTTP2 with curl --version.
  4. Build the smallest correct command. Use --upload-file for raw PUT or --form for multipart; add --form-string for literal untrusted values.
  5. Try normal HTTP/2 negotiation. Use --http2 over HTTPS rather than prior knowledge.
  6. Verify the result. Capture verbose or trace output, negotiated protocol, HTTP status, and server request identifiers.
  7. Measure the real workload. Test representative sizes, concurrency, latency, proxy paths, retries, and timeouts.
  8. Apply a documented fallback. Force --http1.1 only when evidence shows an interoperability or operational problem.
  9. Maintain the client. Track curl and libcurl security advisories, including the October 2026 HTTP/2 upload issue, and apply the appropriate vendor update.

Bottom line

There is no universal “HTTP/2 upload mode.” Select the endpoint’s body contract first: -T/--upload-file for direct PUT, or -F/--form for multipart form data. Then use HTTPS and let a curl build with HTTP/2 support negotiate normally. HTTP/2 is most compelling when connections carry concurrent requests; a single large file may see little change, so benchmark the deployment instead of quoting a generic speed gain. When a proxy or origin is incompatible, --http1.1 is a valid, explicit fallback—not a different upload format.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.