progresivjose / arc-api-connector
A simple Guzzle Wrapper with some specific params to connect to Arc XP API
Package info
github.com/progresivjose/arc-api-connector
Type:project
pkg:composer/progresivjose/arc-api-connector
2.0
2023-11-16 19:34 UTC
Requires
- php: >=8.2.11
- guzzlehttp/guzzle: ^7.2
Requires (Dev)
- mockery/mockery: ^1.4.4
- pestphp/pest: ^2.24
README
To install the package you should run the followin command
composer require progrevisjose/arc-api-connector:1.0
Usage
First you must initialize the class
import GuzzleHttp\Client; $client = new \Progresivjose\ArcApiConnector(new Client, 'ARC API SECRET TOKEN');
Then you can start making the requests
//making a simple request $this->client->get('https://example.test'); //passing params to the request $this->client->get('https://example.test', ['foo' => 'bar']); //example of post as form_params $this->client->post('https://example.test'. ['name' => 'John', 'lastname' => 'Doe']); //example of post as json body $this->client->post('http://example.test', ['name' => 'John', 'lastname' => 'Doe'], 'json'); //example of post as multipart $this->client->post('http://example.test', ['name' => 'John', 'lastname' => 'Doe'], 'multipart');
Available methods
- get
- post
- put
- delete