Skip to content

sagar290/AlpineRestApi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AlpineRestApi

Wordpress rest api. Easy to make and customise

Supported method

    'GET',
    'POST',
    'PUT',
    'PATTCH',
    'DELETE',
    'PURGE',
    'UNLINK',
    'HEAD',

Method parameter

Route::get('namespace', 'endpoint', 'callback',  'permission_callback');

Example

use Sagar290\RestApi\AlpineRestApi as Route 

function method($request) {
    $name  =  $request['name'];
    wp_send_json_success($name, 200);
}

Route::post('namespace/v1', '/addProduct', "method");

You can access this by

Body

{
    "name": "sagar"
}
POST https://yourdomin.com/wp-json/namespace/v1/addProduct

Response

{

    "success":  true,
    "data":  "Sagar"

}

About

Wordpress rest api. Easy to make and customise

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages