-2

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

1 Answers1

0

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 GuzzleHttp\Client();

$res = $client->request("POST", "https://endpoint.com", [
    "proxy" => "http://username:password@proxy.ip.address",
]);
this worked with guzzle in php.
Masoud
  • 1,099
  • 1
  • 10
  • 22