How to make an HTTP request from a plugin? I'd like to be able to make HTTP requests from within my plugin to hit an endpoint and get a response. How can I do this?
Craft uses an HTTP library called Guzzle, and it's built-in so you can import and use it from within your plugin. Here's an example:

// imports
use GuzzleHttp;

// GET request

$client = new GuzzleHttp\Client();
$response = $client-&gt;request('GET', 'https://example.com', [
  'query' =&gt; ['exampleParam' =&gt; 'example']
]);
$responseBody = json_decode($response-&gt;getBody(), true);

// POST request
$client = new GuzzleHttp\Client();
$response = $client-&gt;request('POST', 'https://example.com/api', [
  'form_params' =&gt; [
    'example' =&gt; 'example',
  ]
]);
$responseBody = json_decode($response-&gt;getBody(), true);


To figure out how to properly format your Guzzle request, refer to the Guzzle Docs.