Skip to Content
Sindre Sorhus
Back to Actions

Updated

How to Run a cURL Command on iPhone

By Sindre Sorhus, who makes the Actions app

With Actions

  1. Install Actions, and open it once.
  2. In the Shortcuts app, make a new shortcut, and add the “Run cURL Command” action.
  3. Paste the command in the action, like curl -X POST 'https://httpbin.org/post' -H 'Content-Type: application/json' -d '{"name":"John"}'.
  4. Add the “Show Content” action, and run the shortcut.

The result is the response, with its status code, its headers, and its body. You can use each part in the next actions, like an “If” action on the status code.

The action supports the common options, like -X, -H, -d, -u, -L, -m, -A, -G, -I, and --compressed. It ignores -s, -v, and -o. Another option gives an error, as it could change the request, and --data-binary @file does not work. On iPhone, iOS stops an action of an app after about 30 seconds, so a large upload can fail.

Get Actions

Additional actions for the Shortcuts app

Download on the App Store

Free

Requires
iOS 26 or later
Updated
June 2026
US App Store rating
4.8/5 (706 ratings)

More about Actions

Without an app

The built-in “Get Contents of URL” action of Shortcuts sends a request too. Tap “Show More” in the action to choose the method, like “POST”, and to add headers. For “POST”, “PUT”, and “PATCH”, the action also has “Request Body”, which can be JSON, a form, or a file. Apple

It works, but you must put each part of the command in its own field. The “Run cURL Command” action is faster when you already have a curl command.