_command->getData(); $url = $data["Url"]; $method = isset($data["Method"]) ? $data["Method"] : "POST"; $options = isset($data["Options"]) ? $data["Options"] : array(); $client = new Client(); try { $response = $client->request($method, $url, $options); } catch (ClientException $e) { $response = $e->getResponse(); if (!is_null($response)) { LuLog::log($response->getBody()); } LuLog::log($e); abort(500, "Failed to execute request (client)"); } catch (RequestException $e) { $response = $e->getResponse(); if (!is_null($response)) { LuLog::log($response->getBody()); } LuLog::log($e); abort(500, "Failed to execute request (request)"); } catch (\Exception $e) { LuLog::log($e); abort(500, "Failed to execute request (unknown)"); } if ($response->getStatusCode() != 200) { abort(500, "Failed to execute request (" . $response->getStatusCode() . ")"); } return true; } }