Skip to content

How to copy a Safari request as cURL

Safari can hand you a ready-made cURL command for any request it makes, which is the fastest way to move a working browser call into a script, a test, or a converter.

OUTPUT FORMATSHTMLJSONMarkdown

The whole flow is short: open the Network tab, pick the request, choose Copy as cURL, then paste the result into a curl converter if you want another language.

The four-step flow

  1. Open the Network tab in Safari's Developer Tools.
  2. Right-click the request you want (Ctrl-click or a two-finger click also opens the menu).
  3. Choose "Copy as cURL" from the dropdown.
  4. Paste the copied command into a curl converter to translate it into the language you want.

That is the entire procedure. The rest of this page is about doing it without copying the wrong request.

Before you copy: a quick checklist

The Network tab fills up with every request the page makes — images, fonts, analytics beacons, API calls. Copying the first row you see is the most common way to end up with a cURL command that does nothing useful.

  • Confirm the request you want is the one that actually carries the data or action you care about, not a static asset.
  • Check the method (GET, POST, and so on) matches what you expect.
  • If the request has a body, make sure the row you picked is the one with that body.
  • Reload the page or repeat the action if the list looks empty or stale.
  • Copy once, then paste somewhere you can inspect it before converting.

What a copied cURL command contains

A cURL command copied from Safari is a plain-text description of one HTTP request. Before you convert it, it helps to know what you are looking at:

  • The URL — the destination of the request.
  • The method — usually GET or POST, sometimes others.
  • Headers — things like content type, cookies, and authorization values that the server expects.
  • The body — present on requests that send data, such as form submissions or JSON payloads.

If any of these look wrong or missing compared with what you saw in the Network tab, re-copy the request rather than editing the command by hand.

When it doesn't work: three different problems

It is easy to blame the converter when the real issue is earlier in the flow. Separate the failure before you fix it:

  • Empty or missing Network tab. The Developer Tools are not open, or the page has not made requests since you opened them. Reload the page with the tab open.
  • Wrong request copied. The cURL command runs but returns an error, a login page, or nothing useful. Go back to the Network tab and pick the request that matches the action you actually performed.
  • Converter output doesn't match. The cURL command itself is fine, but the generated code uses a different language or library than you expected. Check the converter's target language setting before assuming the copy failed.

A worked example

Suppose a page loads a list of items by calling an endpoint after you click a filter. In the Network tab, that call appears as a separate row with a method and a URL. Right-click that row, choose Copy as cURL, and paste the result into a converter set to your target language. The generated code should contain the same URL, method, and headers you saw in the row. If it doesn't, you copied a different request.

Frequently asked questions

Do I need to enable the Develop menu in Safari first?

Yes. The Network tab lives inside Safari's Developer Tools, so the Develop menu has to be available before you can open it. Apple's Safari developer documentation covers enabling it.

Can I copy more than one request at a time?

The Copy as cURL option works on a single selected request. If you need several calls, copy them one at a time.

What if the copied command contains a session cookie or token?

Treat the copied command as sensitive. It can include cookies and authorization headers that identify your session, so avoid pasting it into public places or sharing it in screenshots.