Convert Curl Commands to code Online

Curl command

Examples: GET - POST - JSON - Basic Auth - Files - Form

Curl to code Online

This tool helps you to generate code based on Curl Command. Copy and Paste Curl Command and Generate code.

What can you do with Curl to code Converter Online?

  • Curl to code is very unique tool to convert curl command to http request of code. The input provide by the user's curl command to generate Code.
  • This tool saves your time and helps to generate code with ease.
  • Curl to code works well on Windows, MAC, Linux, Chrome, Firefox, Edge, and Safari.

what is Curl?

cURL is an open-source command line tool that downloads files from the web. It supports a variety of protocols, including HTTP, HTTPS, FTP, SFTP, TFTP, Gopher and others.

How do convert Curl to PHP code? 

Step1: Paste and convert your Curl requests to PHP code.
Step2: Copy PHP Code

Curl to code example

Curl Command
curl example.com
Code
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://example.com');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');

$response = curl_exec($ch);

curl_close($ch);