public ping ( SS_HTTPRequest $request ) : SS_HTTPResponse | ||
$request | SS_HTTPRequest | |
return | SS_HTTPResponse |
public function ping(\SS_HTTPRequest $request)
{
if (!$this->record->canView($this->getMember())) {
return $this->message('You are not authorized to do that on this environment', 403);
}
switch ($request->httpMethod()) {
case 'GET':
return $this->getPing($this->getRequest()->param('ID'));
case 'POST':
return $this->createPing();
default:
return $this->message('API not found', 404);
}
}