Download the PHP package dukt/rest without Composer
On this page you can find all versions of the php package dukt/rest. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package rest
REST for Craft CMS
Perform authenticated REST requests
Table of Contents
- Installing and updating
- Requirements
- Installation
- Updating
- Requests
- Simple Request
- Query Parameters
- Authentication
- Token
- Authentications
Installing and updating
Requirements
- Craft 2.5
- Craft OAuth 1.0
Installation
- Download the latest release of the plugin
- Drop the
rest
plugin folder tocraft/plugins
- Install REST plugin from the control panel in
Settings > Plugins
Updating
- Download the latest release of the plugin
- Replace the
rest
plugin folder by the new one undercraft/plugins
- Access your Craft control panel. You might be prompted to "Finish Up" the update if one or more migrations need to be applied.
Requests
Simple Request
{% set response = craft.rest.request.url('http://api.openweathermap.org/data/2.5/weather?q=London,uk&appid=2de143494c0b295cca9337e1e96b00e0').send() %}
<pre>{{ dump(response) }}</pre>
Query Parameters
{% set response = craft.rest.request
.url('http://api.openweathermap.org/data/2.5/weather')
.query({
q: 'London,uk',
appid: '2de143494c0b295cca9337e1e96b00e0',
})
.send() %}
Authentication
{% set response = craft.rest.request
.authentication('youtube')
.url('https://www.googleapis.com/youtube/v3/search')
.query({
part: 'snippet',
q: 'timelapse',
})
.send() %}
Token
{% set response = craft.oauth.getTokenById(123) %}
{% set response = craft.rest.request
.token(token)
.url('https://www.googleapis.com/youtube/v3/search')
.query({
part: 'snippet',
q: 'timelapse',
})
.send() %}
Authentications
Supported Providers
You can set up authentication with any OAuth provider provided by the OAuth plugin:
- GitHub
- Slack
- Vimeo
The plugin also supports any third party OAuth providers supported by the OAuth plugin.
Dukt.net © 2017 - All rights reserved
All versions of rest with dependencies
PHP Build Version
Package Version
No informations.
The package dukt/rest contains the following files
Loading the files please wait ....