PHPackages                             prateekkathal/laravel-simplecurl - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. prateekkathal/laravel-simplecurl

ActiveProject[HTTP &amp; Networking](/categories/http)

prateekkathal/laravel-simplecurl
================================

A Laravel package for handling simple CURL requests

v0.2.7(8y ago)86.7k↓53.3%3MITPHPPHP &gt;=5.5.0

Since Sep 8Pushed 8y ago1 watchersCompare

[ Source](https://github.com/prateekkathal/laravel-simplecurl)[ Packagist](https://packagist.org/packages/prateekkathal/laravel-simplecurl)[ RSS](/packages/prateekkathal-laravel-simplecurl/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (19)Used By (0)

Laravel SimpleCurl
==================

[](#laravel-simplecurl)

A Laravel package for handling simple CURL requests... **the Laravel way...**

For installation,
-----------------

[](#for-installation)

- In terminal, paste this

```
composer require prateekkathal/laravel-simplecurl 0.*
```

- Open **app.php** and add this in the **'providers'** array

```
PrateekKathal\SimpleCurl\SimpleCurlServiceProvider::class,
```

- Then add this to the **'aliases'** array

```
'SimpleCurl' => PrateekKathal\SimpleCurl\SimpleCurlFacade::class,
```

Request Functions
-----------------

[](#request-functions)

Function NameReturn TypeExampleget()SimpleCurlSimpleCurl::get($url = '', $data = \[\], $headers = \[\])post()SimpleCurlSimpleCurl::post($url = '', $data = \[\], $headers = \[\], $file = false)put()SimpleCurlSimpleCurl::put($url = '', $data = \[\], $headers = \[\])delete()SimpleCurlSimpleCurl::delete($url = '', $data = \[\], $headers = \[\])Response Functions
------------------

[](#response-functions)

Function NameReturn TypeExamplegetResponse()array\['http\_code' =&gt; 200, 'result' =&gt; ...\]getResponseCode()array200getRequestUrl()string'....'getRequestSize()int300getTotalTime()int0.2getResponseContentType()string'application/json'getRedirectCount()int0getEffectiveUrl()string'....'getCurlError()string'URL is not properly formatted'getResponseAsArray()array\['id' =&gt; 1, 'name' =&gt; Prateek Kathal ...\]getResponseAsJson()json{"id": 1, "name": "Prateek Kathal" ...}getResponseAsCollection()CollectionCollection =&gt; { \[ 0 =&gt; {"id": 1, "name": "Prateek Kathal" }... \] }getPaginatedResponse()LengthAwarePaginatorLengthAwarePaginator =&gt; { 'total' =&gt; 10, per\_page =&gt; 10, data =&gt; \[ { "id": 1, "name": "Prateek Kathal" }... } \]getResponseAsModel()ModelUser =&gt; { "attributes" : { "id": 1, "name": "Prateek Kathal" } }Making simple **GET/POST/PUT/DELETE** requests,
-----------------------------------------------

[](#making-simple-getpostputdelete-requests)

**Without Config Variables**

```
