Skip to main content

Command Palette

Search for a command to run...

cURL Converter - A tool convert cURL commands to Laravel's HTTP Client

Updated
1 min read
cURL Converter - A tool convert cURL commands to Laravel's HTTP Client
D

A passionate full-stack developer from @ePlus.DEV

Last week Shift released the cURL Converter. It allows you to quickly convert curl requests to an Http client request. Now all those example API calls you find within documentation can actually be used for your Laravel apps.

For example, take the following curl example from Fathom.

curl https://api.usefathom.com/v1/account
    -H "Authorization: Bearer API_TOKEN_HERE"

Shift's cURL Converter outputs its equivalent Http request:

Http::withToken('API_TOKEN_HERE')
    ->get('https://api.usefathom.com/v1/account');

The underlying code for Shift's cURL Converter is available as a package on GitHub. This package provides an artisan command which wraps curl, allowing you to convert requests to Http code from the command line.

For convenience, Shift also has an online version of the tool. This allows you to quickly paste and convert curl requests. No need to install a Composer package.

If you’re interested in the development of this tool, JMac (Jason McCreary), the creator of Shift, live streamed coding it. You may also check out the laravel-shift/curl-converter repo to review its code or contribute.

Source:

Laravel

Part 27 of 32

Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling.

Up next

A practical guide to search Eloquent relationships using Laravel Scout Database Driver

Laravel Scout is a tool for adding full-text search functionality to your Laravel applications. It uses drivers like Algolia, Meilisearch, SQL, etc

cURL Converter - A tool convert cURL commands to Laravel's HTTP Client