Skip to content
Advertisement

Get API over VPN with PHP [closed]

I have a question with my problem.

I have a task where I want to get the REST API but the API is through a VPN.

Can I take the API in a VPN using PHP? I use laravel

Sorry if my english is bad

Advertisement

Answer

If you are struggling with api you can use third party library for example guzzle.

And in guzzle you can set proxy server, also for using proxy as you know you should have a proper proxy account wich known with username and password

For example something like this:

$client = new GuzzleHttpClient();

$res = $client->request("POST", "https://endpoint.com", [
    "proxy" => "http://username:password@proxy.ip.address",
]);
this worked with guzzle in php.
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement