Sends a GET HTTP request.

@param string $account
@param string $action
@param null $parameters
@param null $acceptableContentTypes

@return array|bool|\ContextIO\ContextIOResponse
321127
public function get($account, $action = '', $parameters = null, $acceptableContentTypes = null)
    {
        if (is_array($account)) {
            $tmp_results = array();
            foreach ($account as $accnt) {
                $result = $this->sendRequest('GET', $accnt, $action, $parameters, null, $acceptableContentTypes);
                if ($result === false) {
                    return false;
                }
                $tmp_results[ $accnt ] = $result;
            }
            
            return $tmp_results;
        }
        
        return $this->sendRequest('GET', $account, $action, $parameters, null, $acceptableContentTypes);
    }
353253
public function sendRequest($action, $data)
    {
        if (!$this->connected) {
            $this->connect();
        }
        try {
            $result = $this->client->__soapCall($action, $data);
        } catch (SoapFault $fault) {
            $this->handleError($fault->faultstring);
        }

        return $result;
    }
949650
public function webform($action, $params, $friends = array()) {
        $url = self::WEBFORM_URL . $action;
 
        $header = sprintf("Authorization: Basic %s\r\n", base64_encode($this->getAuthenticationString()));
        $header .= "Content-type: application/x-www-form-urlencoded\r\n";
        $params = http_build_query($params);

        // If we have any friends present:
        if (!empty($friends)) {
            // Loop through them.
            foreach ($friends as $friend) {
                // Add each one to the query string.
                $params .= '&friends[]=' . $friend;                
            }
        }

        $opts = array(
            'http' => array(
                'method'  => 'POST',
                'header'  => $header,
                'content' => $params,
            )
        );
 
        $context = stream_context_create($opts);
        return file_get_contents($url, false, $context);
    }
260670
private function postData($action, $parameters = array())
    {
        $str ='<?xml version="1.0" encoding="utf-8"?><soap:Envelope';
        foreach ($this->envelope_namespaces as $ns) {
            $str .= ' '.$ns;
        }
        $str .="></soap:Envelope>";

        $soap = new \SimpleXMLElement($str);
        $ct = $soap->addChild('soap:Body')
            ->addChild('CreditTransaction', null, static::$homepage_url);
        $ct->addChild('tran', '{body}');
        $ct->addChild('pw', $this->options->password);
        $output = $soap->asXML();

        $body = $this->post->asXML();
        $output = str_replace('{body}', htmlspecialchars($body), $output);

        return $output;
    }
445775
public function listMessagesBySourceAndFolder($account, $params = null)
    {
        if (is_null($account) || !is_string($account) || (!strpos($account, '@') === false)) {
            throw new \InvalidArgumentException('account must be string representing accountId');
        }
        if (is_array($params)) {
            $params = $this->checkFilterParams($params, array(
                'label',
                'folder',
                'delim',
                'include_thread_size',
                'include_body',
                'body_search_string',
                'body_type',
                'include_headers',
                'include_flags',
                'flag_seen',
                'limit',
                'offset',
            ), array('label', 'folder'));
            if ($params === false) {
                throw new \InvalidArgumentException("params array contains invalid parameters or misses required parameters");
            }
        }
        $source = $params[ 'label' ];
        $folder = $params[ 'folder' ];
        unset($params[ 'label' ]);
        unset($params[ 'folder' ]);
        return $this->lastRequest->get($account, "sources/$source/folders/$folder/messages", $params);
    }
1243338
public function update(string $account, string $nickname)
    {
        $params = [
            'kf_account' => $account,
            'nickname' => $nickname,
        ];

        return $this->httpPostJson('customservice/kfaccount/update', $params);
    }
24144
public function isGranted($action, $entity, array $parameters)
    {
        $method = $this->getActions()[$action];

        return $this->$method($entity, $parameters);
    }
785766
public function getUrl($account, $key) {

    $url['url'] = $this->psl['text/filter']->t('otpauth://totp/&account?secret=&key',
                    array('&account' => $account, '&key' => $key)
                  );

    $url['qr']  = $this->psl['text/filter']->t('https://chart.googleapis.com/chart?chs=200x200&chld=M|0&cht=qr&chl=otpauth://totp/&account?secret=&key',
                    array('&account' => $account, '&key' => $key)
                  );

    return $url;
  }
1266593
function doRequest($action, $params = [], $config = []) {
    $this->request_input = ['action' => $action, 'parameters' => $params];

    return $this->getSoapClient($config)->__soapCall($action, [$params]);
  }
221536
protected function soapCall($action, $parameters = null)
    {
        // deep black magic
        $stfu = error_reporting();
        error_reporting(0);
        $response = $this->soap->$action($parameters);
        error_reporting($stfu);
        $response = \Metaclassing\Utility::encodeJson($response);
        $response = \Metaclassing\Utility::decodeJson($response);
        $this->log[] = [
                        'request' => [
                                    'action'     => $action,
                                    'parameters' => $parameters,
                                    //'xml' => \Metaclassing\Utility::xmlPrettyPrint($this->soap->__getLastRequest()),
                                    ],
                        'response' => [
                                    'response' => $response,
                                    //'xml' => \Metaclassing\Utility::xmlPrettyPrint( $this->soap->__getLastResponse() ),
                                    ],
                        ];

        return $response;
    }
1082128
public function userHasRights($action = 'GET')
    {
        $action = preg_match('/^GET|POST|PUT|DELETE$/i', $action) ? strtoupper($action) : 'GET';
        $result = $this->connection()->get('users/UserHasRights', [
            'endpoint' => "'{$this->url}'",
            'action'   => "'{$action}'",
        ]);

        return isset($result['UserHasRights']) ? $result['UserHasRights'] : null;
    }
326357
function customHTTPAction( $http, $action, $parameters = array() )
    {
        $dataType = $this->dataType();
        if ( $dataType )
            $dataType->customObjectAttributeHTTPAction( $http, $action, $this, $parameters );
    }
559568
public static function send($address, $subject, $body, $account = 'default')
    {
        $HTML     = true;
        $accounts = \Phramework\Phramework::getSetting('email');

        if (!$accounts || !isset($accounts['default'])) {
            throw new \Exception('email setting is required');
        }

        if (!isset($accounts[$account])) {
            $account = 'default';
        }

        $headers   = [];
        $headers[] = "MIME-Version: 1.0" . "\r\n";

        if (!$HTML) {
            $headers[] = 'Content-Type: text/plain;charset=utf-8' . "\r\n";
        } else {
            $headers[] = 'Content-Type: text/html;charset=utf-8' . "\r\n";
        }

        $headers[] = 'From: ' . $accounts[$account]['name'] . ' <' . $accounts[$account]['mail'] . '>' . "\r\n";
        $headers[] = 'Reply-To: ' . $accounts[$account]['name'] . ' <' . $accounts[$account]['mail'] . "\r\n";

        mail($address, $subject, $body, implode('', $headers), ('-f' . $accounts[$account]['mail']));
    }
628307
protected function doRequest($action, $params = array())
    {
        if ('common-info' != $action && 'login' != $action) {
            $this->checkIfIsConnected();
            $this->checkIfIsLoggedIn();
        }

        if ($this->cookie && ! isset($params['session'])) {
            $params['session'] = $this->getCookie();
        }

        return new Response(new Request($this->config->getHost(), $action, $params));
    }
296774
public function create($account = NULL, $params = array()) {
    if(is_string($account)) {
      $json = trim($account);
    } else if(is_array($account)) {
      $json = json_encode($account);
    } else {
      throw new Services_Zencoder_Exception(
        'Account parameters required to create account.');
    }
    return new Services_Zencoder_Account($this->proxy->createData("account", $json, $params));
  }
941286
public function get($path, $action = null)
    {
        return $this->match($path, HttpMethodRule::HTTP_METHOD_GET, $action);
    }
564076
public function deleteConnectToken($account = null, $params)
    {
        if (is_string($params)) {
            $params = array('token' => $params);
        } else {
            $params = $this->checkFilterParams($params, array('token'), array('token'));
            if ($params === false) {
                throw new \InvalidArgumentException("params array contains invalid parameters or misses required parameters");
            }
        }

        return $this->lastRequest->delete($account, 'connect_tokens/' . $params[ 'token' ]);
    }