'/mapado-fetch.json', 'method' => 'POST', 'action' => function() { $jsonRequest = file_get_contents("php://input"); $request = json_decode($jsonRequest, true); $requestUrl = $request['requestUrl']; $token = site()->mapadoToken(); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $requestUrl); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, [ "Authorization: Bearer " . $token ]); $responseString = curl_exec($ch); curl_close($ch); return $responseString; } ];