Instagram\API\Request\BaseRequest::execute PHP Method

execute() public method

Execute the Request
public execute ( ) : object
return object Response Data
    public function execute()
    {
        $response = parent::execute();
        $this->response = $response;
        if ($this->interceptResponse($response)) {
            return null;
        }
        if ($this->throwExceptionIfResponseNotOk() && !$response->isOK() && !$response->isJson()) {
            throw new InstagramException(sprintf("Instagram Request Failed! [%s] [%s]", $this->getEndpoint(), $response->getCode()));
        }
        $this->instagram->setCookies(array_merge($this->instagram->getCookies(), $response->getCookies()));
        if ($this->parseResponse()) {
            return $this->mapper->map($response->getData(), $this->getResponseObject());
        }
        return $response->getData();
    }

Usage Example

Exemplo n.º 1
0
 /**
  * @return LoginResponse
  */
 public function execute()
 {
     return parent::execute();
 }