Skip to content

Instantly share code, notes, and snippets.

@sammymwangangi
Created April 26, 2018 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sammymwangangi/1d53402b9cd14928ab793b11fec98ea7 to your computer and use it in GitHub Desktop.
Save sammymwangangi/1d53402b9cd14928ab793b11fec98ea7 to your computer and use it in GitHub Desktop.
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class ApiTestController extends Controller
{
public function apitest($id){
$clients = Client::where('clientId', $id)->get();
$result[] = ;
foreach($clients as $client){
if($client->verb == GET){
$result[] = $this->testGet($client->url);
}else if($client->verb == POST){
$result[] = $this->testPost($client->url);
}
}
return results;
}
public function testGet($url){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "$url");
curl_setopt($ch, CURLOPT_RETURNTRANSFER);
$output = curl_exec($ch);
curl_close($ch)
}
public function testPost($url){
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment