ixudra / curl

Custom PHP curl library for the Laravel 5 framework - developed by Ixudra
MIT License
561 stars 128 forks source link

Who send a token to header using jwt? #111

Closed mzcoder-hub closed 5 years ago

mzcoder-hub commented 5 years ago

This librart can send jwt token? Like Authorization bearer <token>

How can i implementation that method ? That title should be how not who sorry

elimentz commented 5 years ago

Authorization is just a header, so you can just add it using the withHeader() method:


    use Ixudra\Curl\Facades\Curl;

    $response = Curl::to('http://foo.com/bar')
        ->withHeader('Authorization: Bearer '. $token)
        ->get();