Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sametsahindogan/guzzle-wrapper
A simple wrapper for PHP Guzzle HTTP Client
https://github.com/sametsahindogan/guzzle-wrapper
guzzle guzzlehttp wrapper
Last synced: 4 months ago
JSON representation
A simple wrapper for PHP Guzzle HTTP Client
- Host: GitHub
- URL: https://github.com/sametsahindogan/guzzle-wrapper
- Owner: sametsahindogan
- License: mit
- Created: 2020-01-19T11:22:43.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-02-28T22:47:45.000Z (almost 3 years ago)
- Last Synced: 2024-08-16T17:15:16.708Z (6 months ago)
- Topics: guzzle, guzzlehttp, wrapper
- Language: PHP
- Homepage:
- Size: 9.77 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# guzzle-wrapper
[![GitHub license](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](https://raw.githubusercontent.com/sametsahindogan/guzzle-wrapper/master/LICENSE)
> This package a simple wrapper for [guzzle/guzzle](https://github.com/guzzle/guzzle).
## Requirements
- [guzzle/guzzle](https://github.com/guzzle/guzzle) **>= 7.0**
## Installation
```bash
composer require sametsahindogan/guzzle-wrapper
```## Request
**GET**```php
$api = (new ApiCallBuilder('https://dev.test.com', '/me', ApiCallBuilder::HTTP_GET));$response = $api->call();
```**POST**
```php
$api = (new ApiCallBuilder('https://dev.test.com', '/login', ApiCallBuilder::HTTP_POST));$response = $api->body([ 'Your' => 'Body' ])->call();
```## Options
Here are a few optional methods to you can add your chain;
```php
->headers([ 'Your' => 'Headers' ])
->bearerToken(' Your Token ')
->basicAuth(' Your Credentials ')
->formParams([ 'Your' => 'Params' ])
->multipart([ 'Your' => 'Multipart' ])
->body([ 'Your' => 'Body' ])
->rawBody('Raw Body')
->queryString(' Your Query String ')
```## License
MIT © [Samet Sahindogan](https://github.com/sametsahindogan/laravel-jwtredis/blob/master/LICENSE)