PHP code example of realconnex / http-request

1. Go to this page and download the library: Download realconnex/http-request library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

realconnex / http-request example snippets


public function __construct(HttpRequest $httpRequest)
{
    $this->httpRequest = $httpRequest;
}

$response = $this->httpRequest->sendRequest(
    HttpServices::MC, // service you want to reach
    'api/v1/notifications', // uri
    HttpRequest::METHOD_POST, // method
    $payload // payload
);