Skip to content

cURL Import

Import API requests by pasting cURL commands directly. This is the fastest way to create a mock endpoint from a real API call — copy a cURL command from your browser DevTools, API documentation, or terminal, and API Dev Studio creates a mock endpoint from it.

  1. Click Import in the project toolbar
  2. Select cURL Command
  3. Paste your cURL command into the text area
  4. The command is parsed in real-time with a live preview
  5. Optionally edit the generated endpoint name
  6. Click Import

A new mock endpoint is created with the method, path, and headers extracted from the cURL command.

The cURL parser extracts:

ComponentSource
HTTP method-X / --request flag, or inferred from other flags
URL pathURL argument
Headers-H / --header flags
Request body-d / --data / --data-raw flags
Query parametersExtracted from the URL query string
Authentication-u / --user (Basic auth) or Authorization header (Bearer)

The parser handles cURL commands from various sources:

Right-click a request in Chrome/Firefox DevTools Network tab and select “Copy as cURL”:

Terminal window
curl 'https://api.example.com/users' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer eyJhbG...'

Backslash-continued commands are handled:

Terminal window
curl -X POST https://api.example.com/users \
-H 'Content-Type: application/json' \
-d '{"name": "Alice", "email": "[email protected]"}'

Commands using ^ for line continuation are supported:

Terminal window
curl -X POST https://api.example.com/users ^
-H "Content-Type: application/json" ^
-d "{\"name\": \"Alice\"}"

As you type or paste, the modal shows a live preview of the parsed result:

  • Method and path extracted from the command
  • Headers listed as key-value pairs
  • Body formatted if JSON is detected
  • Warnings for any unrecognized flags or issues

If the command cannot be parsed, an error message explains what went wrong with a suggestion for how to fix it.

  • Copy from browser: Right-click any network request in DevTools and select “Copy as cURL” for the quickest workflow
  • Auto-naming: The endpoint name is auto-generated from the URL path. You can change it before importing.
  • Body handling: For POST/PUT/PATCH requests, the request body from the cURL command is preserved for reference
  • Auth detection: Basic auth (-u user:pass) and Bearer tokens are detected and shown in the preview