yii\authclient\BaseOAuth::createApiRequest PHP Метод

createApiRequest() публичный Метод

The created request will be automatically processed adding access token parameters and signature before sending. You may use [[createRequest()]] to gain full control over request composition and execution.
См. также: createRequest()
С версии: 2.1
public createApiRequest ( ) : Request
Результат yii\httpclient\Request HTTP request instance.
    public function createApiRequest()
    {
        $request = $this->createRequest();
        $request->on(Request::EVENT_BEFORE_SEND, [$this, 'beforeApiRequestSend']);
        return $request;
    }

Usage Example

Пример #1
0
 /**
  * @inheritdoc
  */
 public function createApiRequest()
 {
     $request = parent::createApiRequest();
     // ensure correct event handlers order :
     $request->off(Request::EVENT_BEFORE_SEND, [$this, 'beforeRequestSend']);
     $request->on(Request::EVENT_BEFORE_SEND, [$this, 'beforeRequestSend']);
     return $request;
 }