Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ixudra's avatar

Package testing

Hi all

I just released the latest version of my cURL package. This version includes a fluent interface similar to the Laravel query builder which can be used to configure the request before sending it. I would love to have some feedback from anyone who has a little time as to how I can still improve the package in any way possible.

https://github.com/ixudra/curl

Some usage examples:


    // Send a GET request to: http://www.foo.com/bar?foz=baz using JSON
    Curl::to('http://www.foo.com/bar')
        ->withData( array( 'foz' => 'baz' ) )
        ->asJson()
        ->get();

    // Send a POST request to: http://www.foo.com/bar
    Curl::to('http://www.foo.com/bar')
        ->post();

    // Send a POST request to: http://www.foo.com/bar with arguments 'foz' = 'baz' using JSON over SSL
    Curl::to('http://www.foo.com/bar')
        ->withData( array( 'foz' => 'baz' ) )
        ->withOption('SSL_VERIFYPEER', false)
        ->post();

Thx in advance!

0 likes
0 replies

Please or to participate in this conversation.