progresivjose/arc-api-connector

A simple Guzzle Wrapper with some specific params to connect to Arc XP API

2.0 2023-11-16 19:34 UTC

This package is auto-updated.

Last update: 2024-09-16 21:28:25 UTC


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