Php2curl
tiny lib to convert data from PHP request to CURL command. Then, CURL command can be imported into Postman with 1 click, so it is PHP to Postman export tool.
Install / Use
/learn @ivastly/Php2curlREADME
php2curl
Convert PHP request to raw cURL instantly.
This tiny lib analyzes PHP globals ($_REQUEST, etc.) and creates identical cURL command out of it.
You can then immediately import it to Postman in 2 clicks via Import -> Paste Raw Text
Possible use cases
-
importing web request from PHP code to plain cURL
-
importing web request from PHP code to Postman
-
cowboy style debugging while xdebug is not available (e.g. production)
-
trying to debug a microservice
-
sharing a request with a co-worker
-
so on
Examples
- zero configuration! copy/paste single line, initiate web request, result will be found in
$curlvariable:
$curl = eval(file_get_contents('http://bit.ly/_php2curl')); // $curl variable contains the cURL command here
-
if you think eval is not acceptable, you can just copy the contents of
generated/snippet.phpand paste it anywhere in your project.$curlvariable will hold the desired cURL command. -
you can install the library as usual via composer (see example.php)
composer require biganfa/php2curl
Known limitations (pull requests are welcome!)
- files are not supported
Tests
vendor/bin/phpunit
License information
see LICENSE file
Related Skills
node-connect
337.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
337.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.2kCommit, push, and open a PR
