progresivjose / arc-api-connector
A simple Guzzle Wrapper with some specific params to connect to Arc XP API
Installs: 12
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:project
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