rodrigo-dechen / rest
There is no license information available for the latest version (dev-master) of this package.
Pacote para criação de seridor rest
dev-master
2018-09-06 18:51 UTC
Requires
- php: ^5.3.3 || ^7.0
- lliure/llrequest: ^v1
This package is auto-updated.
Last update: 2024-10-18 03:56:13 UTC
README
Pequena classe para criar use server rest
Server
$_HEAD = [ // Obrigario 'verbo' => 'METHOD', // GET | POST | PUT | DELETE // Opcional 'login' => $_SERVER['PHP_AUTH_USER'], 'password' => $_SERVER['PHP_AUTH_PW'], ]; $_DATA = []; $api = '\Teste\Teste'; $api = new $api(); $apiReturn = $api->request($_HEAD, $_DATA);
Comando
namespace Teste; use Rest\Rest; class Teste extends Rest{ // confere o login do usuario protected function auth($_HEAD, $_DATA = []){ // $_HEAD['login'] // $_HEAD['password'] return true; } protected function POST($_DATA){ // Cria o registro no sistemna } }