Created
April 26, 2018 14:00
-
-
Save sammymwangangi/1d53402b9cd14928ab793b11fec98ea7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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