1. Go to this page and download the library: Download benegedeniz/apiman 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/ */
benegedeniz / apiman example snippets
new APIMan("https://api.benegedeniz.com/apitest"); // Creating a new APIMan handle with API endpoint URL.
$api->setHeaders([ // Setting headers to send (Optional, if you don't want to set headers, do not use this method.)
"User-Agent: APIMan UG"
]);
$api->setSSLConfig([ // Setting SSL configuration (Required. Leave this as it is if you don't know what is this.)
"SSL_VERIFYPEER" => true, // Required parameter. (If you get blank response from API, set this to false. If so, there is a good chance that you are using your own localhost.)
"SSL_VERIFYHOST" => true // Required parameter.
]);
$api->setLogFile("log.txt"); // Logging file location. (Optional, if you don't want to use logging, don't use this method.)
$api->setHTTPAuth("username:password"); // Setting basic HTTP authentication credentials (Optional, if you don't want to use HTTP authentication, don't use this method.)
$api->setProxy([ // Setting proxy tunnel (Optional, if you don't want to use proxy, don't use this method.)
"proxy" => "204.101.61.82:4145", // Required, proxy IP. Format: ip:port.
"proxyType" => "socks5", // Required, proxy type. Supported types: http, https, socks4 and socks5.
"auth" => "username:password" // Optional, proxy authentication. Format: username:password.
]);
$api->setRequestType("post"); // Setting request type. Supported request types are: get, post, put and delete.
$api->setData(http_build_query(["testParam" => "Test value"])); // Setting data to send. You can send raw body too.
$api->executeRequest(); // Sending request.
echo $api->getRawResponse(); // Getting API response.
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.