This commit is contained in:
Gerald Raab
2017-09-01 14:55:35 +02:00
+3 -25
View File
@@ -2,8 +2,6 @@
if (! defined('BASEPATH')) exit('No direct script access allowed');
//require_once APPPATH . '/libraries/REST_Controller.php';
/**
* Testing class for REST calls and authentication
*/
@@ -16,37 +14,17 @@ class Test extends APIv1_Controller
/**
* Test HTTP GET method
* It responses whith the HTTP status 200 and prints this JSON string
* {"success":true,"message":"API HTTP GET call test succeed"}
*
* @return void
*/
public function getTest()
{
$payload = [
'success' => TRUE,
'message' => 'API HTTP GET call test succeed',
'error' => 0
];
$httpstatus = REST_Controller::HTTP_OK;
$this->response($payload, $httpstatus);
$this->response(success('API HTTP GET call test succeed'), REST_Controller::HTTP_OK);
}
/**
* Test HTTP POST method
* * It responses whith the HTTP status 200 and prints this JSON string
* {"success":true,"message":"API HTTP POST call test succeed"}
*
* @return void
*/
public function postTest()
{
$payload = [
'success' => TRUE,
'message' => 'API HTTP POST call test succeed',
'error' => 0
];
$httpstatus = REST_Controller::HTTP_OK;
$this->response($payload, $httpstatus);
$this->response(success('API HTTP POST call test succeed'), REST_Controller::HTTP_OK);
}
}