Skip to content

zhuravljov/yii2-rest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yii2 REST Client

Latest Stable Version Build Status

What is this?

Screen

Installation

The preferred way to install this extension is through composer.

Add

"zhuravljov/yii2-rest": "*",
"yiisoft/yii2-httpclient": "@dev"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply modify your application configuration as follows:

return [
    'bootstrap' => ['rest-client'],
    'modules' => [
        'rest-client' => [
            'class' => 'zhuravljov\yii\rest\Module',
            'name' => 'My Rest Client',
            'baseUrl' => 'http://localhost/api/v1',
        ],
    ],
];

You can then access Rest Client through the following URL:

http://localhost/path/to/index.php?r=rest-client

or if you have enabled pretty URLs, you may use the following URL:

http://localhost/path/to/index.php/rest-client