private function _validate($token)
    {

        $request = $this->_httpClient->createRequest('POST', $this->_tokenServiceUrl . 'validate');
        $postBody = $request->getBody();


        // $postBody is an instance of GuzzleHttp\Post\PostBodyInterface
        $postBody->setField('service', $this->_appID);
        $postBody->setField('token', $token);

        // Send the POST request
        try {
            $response = $this->_httpClient->send($request);
        } catch (ClientException $e) {
            return "BAD_TOKEN";
        } catch (ServerException $e) {
            return "SERVER_ERROR";
        }

        return $response->json();

    }
private function _validate($token)
    {

        $request = $this->_httpClient->createRequest('POST', $this->_tokenServiceUrl . 'validate');
        $postBody = $request->getBody();


        // $postBody is an instance of GuzzleHttp\Post\PostBodyInterface
        $postBody->setField('service', $this->_appID);
        $postBody->setField('token', $token);

        // Send the POST request
        try {
            $response = $this->_httpClient->send($request);
        } catch (ClientException $e) {
            return "BAD_TOKEN";
        } catch (ServerException $e) {
            return "SERVER_ERROR";
        }

        return $response->json();

    }
private function _validate ( $ token ) { $ request = $ this -> _httpClient -> createRequest ( 'POST' , $ this -> _tokenServiceUrl . 'validate' ) ; $ postBody = $ request -> getBody ( ) ; // $postBody is an instance of GuzzleHttp\Post\PostBodyInterface $ postBody -> setField ( 'service' , $ this -> _appID ) ; $ postBody -> setField ( 'token' , $ token ) ; // Send the POST request try { $ response = $ this -> _httpClient -> send ( $ request ) ; } catch ( ClientException $ e ) { return "BAD_TOKEN" ; } catch ( ServerException $ e ) { return "SERVER_ERROR" ; } return $ response -> json ( ) ; }
Used to _validate an existing token

@param string $token Token to _validate

@return array
Used to _validate an existing token