use Symfony\Component\HttpFoundation\Request; $request = Request::createFromGlobals(); $request->setMethod('GET');
use GuzzleHttp\Client; use GuzzleHttp\Psr7\Request; $client = new Client(); $request = new Request('POST', 'http://example.com/api'); $request->setMethod('POST'); $response = $client->send($request, ['body' => 'foo=bar']); echo $response->getStatusCode();
$url = 'http://example.com/api'; $data = [ 'foo' => 'bar', 'baz' => 'qux' ]; $curl = curl_init($url); curl_setopt($curl, CURLOPT_PUT, true); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $data); $response = curl_exec($curl); echo $response;Based on the examples, it seems like the Symfony HTTP Foundation, GuzzleHttp, and PHP's built-in cURL library are the packages being used.