Hoppscotch cURL Import: What Actually Works and What Gets Lost
Hoppscotch's cURL import handles headers, query params, and basic auth reliably, but drops multipart forms, cookies, and shell expansions. Here's what survives translation, a worked example showing the gaps, and a verification checklist before you send.
23 Sept 2025, 22:40 UTC

The Problem: cURL Commands Don't Always Survive the Round Trip
You copy a cURL command from a colleague's terminal, a CI log, or an API docs page. You paste it into Hoppscotch's import dialog, hit import, and... something's off. The Authorization header is missing. The multipart form turned into JSON. The redirect behavior changed. This isn't a bug—it's a design choice. Hoppscotch's cURL importer is a convenience layer, not a full cURL engine. Understanding what survives the translation and what doesn't saves you from debugging phantom API issues.
What the Importer Actually Handles
When you choose Import > cURL in Hoppscotch (hosted app, PWA, or self-hosted), the parser extracts these flags reliably:
-Xor--request→ HTTP method-Hor--header→ Headers (multiple allowed)-d,--data,--data-raw→ Request body as raw text--data-binary→ Body preserved byte-for-byte-uor--user→ Basic auth header (auto-encoded)--compressed→ AddsAccept-Encoding: gzip, deflate- URL query parameters → Parsed into the query tab
The imported request lands in the request builder where you can save it to a collection. If you're signed in or running a self-hosted instance with sync enabled, the collection persists across devices. Otherwise it stays in browser storage—local-only.
Worked Example: From Terminal to Collection
Suppose a teammate shares this command for a file upload endpoint:
curl -X POST 'https://api.example.com/v1/uploads?project=alpha' \
-H 'Authorization: Bearer sk_live_abc123' \
-H 'Content-Type: multipart/form-data' \
-F 'file=@./report.pdf' \
-F 'metadata={"tags":["quarterly"]}' \
-u 'deploy:secret123' \
--compressed
Paste it into Hoppscotch's cURL import. Here's what you'll get:
- Method:
POST✓ - URL:
https://api.example.com/v1/uploads?project=alpha✓ - Headers:
Authorization: Bearer sk_live_abc123andContent-Type: multipart/form-data✓ - Basic auth header from
-u→Authorization: Basic ZGVwbG95OnNlY3JldDEyMw==⚠️ (conflicts with Bearer token) - Body: Empty —
-Fmultipart fields are dropped - Query param
project=alphaappears in the Query tab ✓ Accept-Encoding: gzip, deflateadded from--compressed✓
The multipart form data is gone. The conflicting auth headers need manual resolution. You'll need to rebuild the multipart body in Hoppscotch's Body > Form-data tab, then delete the duplicate Authorization header.
Where the Translation Breaks Down
| cURL Flag | Hoppscotch Result | Workaround |
|---|---|---|
-b, --cookie | Ignored | Manually add Cookie header |
-F, --form | Dropped entirely | Rebuild in Form-data tab |
-L, --location | Not applied | Hoppscotch follows redirects by default; disable in settings if needed |
--data-urlencode | Treated as raw -d | Pre-encode values before import |
Shell globbing (@file, @-) | Literal string | Paste file content or use file upload in UI |
-k, --insecure | Ignored | TLS validation is browser-controlled |
Environment variables using {{variable}} syntax work in the imported URL and headers—useful for switching between {{base_url}}/v1/resource across dev/staging/prod environments. But they won't expand inside a pasted cURL body unless you manually move values into the variable store.
Verification Checklist Before You Send
- Inspect headers — Check for duplicate Authorization, missing Content-Type, or unexpected Accept-Encoding.
- Confirm body encoding — Raw text vs. form-data vs. JSON matters. The importer defaults to raw text for
-d. - Test against an echo endpoint — Send to
https://httpbin.org/anythingor a localnc -l 8080and compare the outgoing request with your original cURL intent. - Check collection persistence — If you're not signed in, export the collection as JSON (Collection > Export) to avoid losing it on browser clear.
Closing: Treat Import as a Starting Point
Hoppscotch's cURL import eliminates the tedious manual field mapping for straightforward requests. For anything involving multipart forms, cookie jars, redirect logic, or shell expansions, treat the imported request as a scaffold—verify every field, rebuild the body, and test before relying on it in a workflow. The parser lives in the Hoppscotch source under src/utils/curlImporter.ts if you need to audit flag support for your deployed version. When in doubt, paste the cURL into a terminal first, capture the actual request with --trace-ascii, then replicate the essentials manually.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.