Get

@return Payload
8058
public function get($data = [])
	{
		// Process data given.
		$processPayload = $this->process(__FUNCTION__, $data);

		if( ! $processPayload->isStatus(Payload::STATUS_VALID))
		{
			return $processPayload;
		}

		return $this->dataSource->get($data);
	}
303401
function fetch() {
		// Unmask payload
		$server=$this->server;
		if (is_bool($buf=$server->read($this->socket)))
			return FALSE;
		$op=ord($buf[0]) & WS::OpCode;
		$len=ord($buf[1]) & WS::Length;
		$pos=2;
		if ($len==0x7e) {
			$len=ord($buf[2])*256+ord($buf[3]);
			$pos+=2;
		}
		else
		if ($len==0x7f) {
			for ($i=0,$len=0;$i<8;$i++)
				$len=$len*256+ord($buf[$i+2]);
			$pos+=8;
		}
		for ($i=0,$mask=[];$i<4;$i++)
			$mask[$i]=ord($buf[$pos+$i]);
		$pos+=4;
		if (strlen($buf)<$len+$pos)
			return FALSE;
		for ($i=0,$data='';$i<$len;$i++)
			$data.=chr(ord($buf[$pos+$i])^$mask[$i%4]);
		// Dispatch
		switch ($op & WS::OpCode) {
		case WS::Ping:
			$this->send(WS::Pong);
			break;
		case WS::Close:
			$server->close($this->socket);
			break;
		case WS::Text:
			$data=trim($data);
		case WS::Binary:
			if (isset($this->events['receive']) &&
				is_callable($func=$this->events['receive']))
				$func($this,$op,$data);
			break;
		}
		return [$op,$data];
	}
262361
public function getPayload($key = null)
    {
        if (is_null($key)) {
            return $this->payload;
        }

        return isset($this->payload[$key]) ? $this->payload[$key] : null;
    }
124285
protected function getPayloadOffset()
    {
        if (!isset($this->offset_payload)) {
            $offset = $this->getMaskOffset();
            $offset += $this->getMaskSize();

            $this->offset_payload = $offset;
        }
        return $this->offset_payload;
    }
689850
public function get(string $url, ?array $payload = null): TransportClientResponse {
        return $this->sendRequest($url . static::QUESTION_MARK . http_build_query($payload), array());
    }
693486
public function getPayloadObject()
    {
        if (!isset($this->_dataObject) && !empty($this->payload)) {
            $this->_dataObject = unserialize($this->payload);
            $this->_dataObject->model = $this;
        }

        return $this->_dataObject;
    }
249918
function payload()
    {
        if ( $this->IsFault )
        {
            $payload = xmlrpc_encode( array(
                "faultCode" => $this->FaultCode,
                "faultString" => $this->FaultString ) );
            return str_replace( array( '<fault>', '</fault>' ), array( '<methodResponse><fault>', '</fault></methodResponse>' ), $payload );
        }
        else
        {
            $payload = xmlrpc_encode( $this->Value );
            /// @todo verify if user gave us back an array with faultString / faultCode members,
            ///       as we will be sending back junk in that case...
            return str_replace( array( '<params>', '</params>' ), array( '<methodResponse><params>', '</params></methodResponse>' ), $payload );
        }
    }
1208961
private function queryPayload($payload, $path = null)
    {
        if(is_null($path)) return $payload;

        if(array_key_exists($path, $payload)) {
            return $payload[$path];
        }

        $dotData = Arr::dot($payload);
        if(array_key_exists($path, $dotData)) {
            return $dotData[$path];
        }

        return null;
    }
1355568
public function toData()
    {
        $payload = (new ButtonTransformer)->transform($this);
        $this->setPayload($payload);

        return parent::toData();
    }
1102793
public function get()
	{
		$this->getName();		
		$this->obj = "DataExtensionObject[".$this->Name."]";		
		$response = parent::get();
		$this->obj = "DataExtensionObject";
		return $response;
	}
646164
public function getPayload(string $key, $default = null)
    {
        if ($this->payload === null) {
            $contentType = $this->getHeader('Content-Type', '');
            if (!$contentType) {
                $contentType = $this->getHeader('Content-type');
            }

            if ($contentType) {
                $contentTypeParts = preg_split('/\s*[;,]\s*/', $contentType);
                $contentType = $contentTypeParts[0];
                $contentType = strtolower($contentType);
                if (isset($this->bodyParsers[$contentType])) {
                    $parser = $this->bodyParsers[$contentType];
                    $this->payload = $parser($this->body);
                }
            }
        }

        return $this->payload[$key] ?? $default;
    }
978601
function get($params = null) {
    $uri = self::_uriWithParams($this->_href, $params);
    $object = self::_get($uri, $this->_client);
    if ($this->_href && !$object->getHref()) {
      $object->setHref($this->_href);
    }
    return $object;
  }
841712
public function fetch() {
        $params = Values::of(array());

        $payload = $this->version->fetch(
            'GET',
            $this->uri,
            $params
        );

        return new SettingsInstance($this->version, $payload);
    }
811561
function getResponse()
    {
        $this->incoming_payload = '';

        if ($this->io_method() == 'socket') {
            // loop until headers have been retrieved
            $data = '';
            while (!isset($lb)) {

                // We might EOF during header read.
                if (feof($this->fp)) {
                    $this->incoming_payload = $data;
                    $this->debug('found no headers before EOF after length ' . strlen($data));
                    $this->debug("received before EOF:\n" . $data);
                    $this->setError('server failed to send headers');

                    return FALSE;
                }

                $tmp    = fgets($this->fp, 256);
                $tmplen = strlen($tmp);
                $this->debug("read line of $tmplen bytes: " . trim($tmp));

                if ($tmplen == 0) {
                    $this->incoming_payload = $data;
                    $this->debug('socket read of headers timed out after length ' . strlen($data));
                    $this->debug("read before timeout: " . $data);
                    $this->setError('socket read of headers timed out');

                    return FALSE;
                }

                $data .= $tmp;
                $pos  = strpos($data, "\r\n\r\n");
                if ($pos > 1) {
                    $lb = "\r\n";
                } else {
                    $pos = strpos($data, "\n\n");
                    if ($pos > 1) {
                        $lb = "\n";
                    }
                }
                // remove 100 headers
                if (isset($lb) && preg_match('/^HTTP\/1.1 100/', $data)) {
                    unset($lb);
                    $data = '';
                }//
            }
            // store header data
            $this->incoming_payload .= $data;
            $this->debug('found end of headers after length ' . strlen($data));
            // process headers
            $header_data            = trim(substr($data, 0, $pos));
            $header_array           = explode($lb, $header_data);
            $this->incoming_headers = [];
            $this->incoming_cookies = [];
            foreach ($header_array as $header_line) {
                $arr = explode(':', $header_line, 2);
                if (count($arr) > 1) {
                    $header_name                          = strtolower(trim($arr[0]));
                    $this->incoming_headers[$header_name] = trim($arr[1]);
                    if ($header_name == 'set-cookie') {
                        // TODO: allow multiple cookies from parseCookie
                        $cookie = $this->parseCookie(trim($arr[1]));
                        if ($cookie) {
                            $this->incoming_cookies[] = $cookie;
                            $this->debug('found cookie: ' . $cookie['name'] . ' = ' . $cookie['value']);
                        } else {
                            $this->debug('did not find cookie in ' . trim($arr[1]));
                        }
                    }
                } elseif (isset($header_name)) {
                    // append continuation line to previous header
                    $this->incoming_headers[$header_name] .= $lb . ' ' . $header_line;
                }
            }

            // loop until msg has been received
            if (isset($this->incoming_headers['transfer-encoding']) && strtolower($this->incoming_headers['transfer-encoding']) == 'chunked') {
                $content_length = 2147483647;    // ignore any content-length header
                $chunked        = TRUE;
                $this->debug("want to read chunked content");
            } elseif (isset($this->incoming_headers['content-length'])) {
                $content_length = $this->incoming_headers['content-length'];
                $chunked        = FALSE;
                $this->debug("want to read content of length $content_length");
            } else {
                $content_length = 2147483647;
                $chunked        = FALSE;
                $this->debug("want to read content to EOF");
            }
            $data = '';
            do {
                if ($chunked) {
                    $tmp    = fgets($this->fp, 256);
                    $tmplen = strlen($tmp);
                    $this->debug("read chunk line of $tmplen bytes");
                    if ($tmplen == 0) {
                        $this->incoming_payload = $data;
                        $this->debug('socket read of chunk length timed out after length ' . strlen($data));
                        $this->debug("read before timeout:\n" . $data);
                        $this->setError('socket read of chunk length timed out');

                        return FALSE;
                    }
                    $content_length = hexdec(trim($tmp));
                    $this->debug("chunk length $content_length");
                }
                $strlen = 0;
                while (($strlen < $content_length) && (!feof($this->fp))) {
                    $readlen = min(8192, $content_length - $strlen);
                    $tmp     = fread($this->fp, $readlen);
                    $tmplen  = strlen($tmp);
                    $this->debug("read buffer of $tmplen bytes");
                    if (($tmplen == 0) && (!feof($this->fp))) {
                        $this->incoming_payload = $data;
                        $this->debug('socket read of body timed out after length ' . strlen($data));
                        $this->debug("read before timeout:\n" . $data);
                        $this->setError('socket read of body timed out');

                        return FALSE;
                    }
                    $strlen += $tmplen;
                    $data   .= $tmp;
                }
                if ($chunked && ($content_length > 0)) {
                    $tmp    = fgets($this->fp, 256);
                    $tmplen = strlen($tmp);
                    $this->debug("read chunk terminator of $tmplen bytes");
                    if ($tmplen == 0) {
                        $this->incoming_payload = $data;
                        $this->debug('socket read of chunk terminator timed out after length ' . strlen($data));
                        $this->debug("read before timeout:\n" . $data);
                        $this->setError('socket read of chunk terminator timed out');

                        return FALSE;
                    }
                }
            }
            while ($chunked && ($content_length > 0) && (!feof($this->fp)));
            if (feof($this->fp)) {
                $this->debug('read to EOF');
            }
            $this->debug('read body of length ' . strlen($data));
            $this->incoming_payload .= $data;
            $this->debug('received a total of ' . strlen($this->incoming_payload) . ' bytes of data from server');

            // close filepointer
            if (
                (isset($this->incoming_headers['connection']) && strtolower($this->incoming_headers['connection']) == 'close') ||
                (!$this->persistentConnection) || feof($this->fp)
            ) {
                fclose($this->fp);
                $this->fp = FALSE;
                $this->debug('closed socket');
            }

            // connection was closed unexpectedly
            if ($this->incoming_payload == '') {
                $this->setError('no response from server');

                return FALSE;
            }

            // decode transfer-encoding
//		if(isset($this->incoming_headers['transfer-encoding']) && strtolower($this->incoming_headers['transfer-encoding']) == 'chunked'){
//			if(!$data = $this->decodeChunked($data, $lb)){
//				$this->setError('Decoding of chunked data failed');
//				return false;
//			}
            //print "<pre>\nde-chunked:\n---------------\n$data\n\n---------------\n</pre>";
            // set decoded payload
//			$this->incoming_payload = $header_data.$lb.$lb.$data;
//		}

        } elseif ($this->io_method() == 'curl') {
            // send and receive
            $this->debug('send and receive with cURL');
            $this->incoming_payload = curl_exec($this->ch);
            $data                   = $this->incoming_payload;

            $cErr = curl_error($this->ch);
            if ($cErr != '') {
                $err = 'cURL ERROR: ' . curl_errno($this->ch) . ': ' . $cErr . '<br>';
                // TODO: there is a PHP bug that can cause this to SEGV for CURLINFO_CONTENT_TYPE
                foreach (curl_getinfo($this->ch) as $k => $v) {
                    if (is_array($v)) {
                        $this->debug("$k: " . json_encode($v));
                    } else {
                        $this->debug("$k: $v<br>");
                    }
                }
                $this->debug($err);
                $this->setError($err);
                curl_close($this->ch);

                return FALSE;
            } else {
                //echo '<pre>';
                //var_dump(curl_getinfo($this->ch));
                //echo '</pre>';
            }
            // close curl
            $this->debug('No cURL error, closing cURL');
            curl_close($this->ch);

            // try removing skippable headers
            $savedata = $data;
            while ($this->isSkippableCurlHeader($data)) {
                $this->debug("Found HTTP header to skip");
                if ($pos = strpos($data, "\r\n\r\n")) {
                    $data = ltrim(substr($data, $pos));
                } elseif ($pos = strpos($data, "\n\n")) {
                    $data = ltrim(substr($data, $pos));
                }
            }

            if ($data == '') {
                // have nothing left; just remove 100 header(s)
                $data = $savedata;
                while (preg_match('/^HTTP\/1.1 100/', $data)) {
                    if ($pos = strpos($data, "\r\n\r\n")) {
                        $data = ltrim(substr($data, $pos));
                    } elseif ($pos = strpos($data, "\n\n")) {
                        $data = ltrim(substr($data, $pos));
                    }
                }
            }

            // separate content from HTTP headers
            if ($pos = strpos($data, "\r\n\r\n")) {
                $lb = "\r\n";
            } elseif ($pos = strpos($data, "\n\n")) {
                $lb = "\n";
            } else {
                $this->debug('no proper separation of headers and document');
                $this->setError('no proper separation of headers and document');

                return FALSE;
            }
            $header_data  = trim(substr($data, 0, $pos));
            $header_array = explode($lb, $header_data);
            $data         = ltrim(substr($data, $pos));
            $this->debug('found proper separation of headers and document');
            $this->debug('cleaned data, stringlen: ' . strlen($data));
            // clean headers
            foreach ($header_array as $header_line) {
                $arr = explode(':', $header_line, 2);
                if (count($arr) > 1) {
                    $header_name                          = strtolower(trim($arr[0]));
                    $this->incoming_headers[$header_name] = trim($arr[1]);
                    if ($header_name == 'set-cookie') {
                        // TODO: allow multiple cookies from parseCookie
                        $cookie = $this->parseCookie(trim($arr[1]));
                        if ($cookie) {
                            $this->incoming_cookies[] = $cookie;
                            $this->debug('found cookie: ' . $cookie['name'] . ' = ' . $cookie['value']);
                        } else {
                            $this->debug('did not find cookie in ' . trim($arr[1]));
                        }
                    }
                } elseif (isset($header_name)) {
                    // append continuation line to previous header
                    $this->incoming_headers[$header_name] .= $lb . ' ' . $header_line;
                }
            }
        }

        $this->response_status_line = $header_array[0];
        $arr                        = explode(' ', $this->response_status_line, 3);
        $http_version               = $arr[0];
        $http_status                = intval($arr[1]);
        $http_reason                = count($arr) > 2 ? $arr[2] : '';

        // see if we need to resend the request with http digest authentication
        if (isset($this->incoming_headers['location']) && ($http_status == 301 || $http_status == 302)) {
            $this->debug("Got $http_status $http_reason with Location: " . $this->incoming_headers['location']);
            $this->setURL($this->incoming_headers['location']);
            $this->tryagain = TRUE;

            return FALSE;
        }

        // see if we need to resend the request with http digest authentication
        if (isset($this->incoming_headers['www-authenticate']) && $http_status == 401) {
            $this->debug("Got 401 $http_reason with WWW-Authenticate: " . $this->incoming_headers['www-authenticate']);
            if (strstr($this->incoming_headers['www-authenticate'], "Digest ")) {
                $this->debug('Server wants digest authentication');
                // remove "Digest " from our elements
                $digestString = str_replace('Digest ', '', $this->incoming_headers['www-authenticate']);

                // parse elements into array
                $digestElements = explode(',', $digestString);
                foreach ($digestElements as $val) {
                    $tempElement                    = explode('=', trim($val), 2);
                    $digestRequest[$tempElement[0]] = str_replace("\"", '', $tempElement[1]);
                }

                // should have (at least) qop, realm, nonce
                if (isset($digestRequest['nonce'])) {
                    $this->setCredentials($this->username, $this->password, 'digest', $digestRequest);
                    $this->tryagain = TRUE;

                    return FALSE;
                }
            }
            $this->debug('HTTP authentication failed');
            $this->setError('HTTP authentication failed');

            return FALSE;
        }

        if (
            ($http_status >= 300 && $http_status <= 307) ||
            ($http_status >= 400 && $http_status <= 417) ||
            ($http_status >= 501 && $http_status <= 505)
        ) {
            $this->setError("Unsupported HTTP response status $http_status $http_reason (soapclient->response has contents of the response)");

            return FALSE;
        }

        // decode content-encoding
        if (isset($this->incoming_headers['content-encoding']) && $this->incoming_headers['content-encoding'] != '') {
            if (strtolower($this->incoming_headers['content-encoding']) == 'deflate' || strtolower($this->incoming_headers['content-encoding']) == 'gzip') {
                // if decoding works, use it. else assume data wasn't gzencoded
                if (function_exists('gzinflate')) {
                    //$timer->setMarker('starting decoding of gzip/deflated content');
                    // IIS 5 requires gzinflate instead of gzuncompress (similar to IE 5 and gzdeflate v. gzcompress)
                    // this means there are no Zlib headers, although there should be
                    $this->debug('The gzinflate function exists');
                    $datalen = strlen($data);
                    if ($this->incoming_headers['content-encoding'] == 'deflate') {
                        if ($degzdata = @gzinflate($data)) {
                            $data = $degzdata;
                            $this->debug('The payload has been inflated to ' . strlen($data) . ' bytes');
                            if (strlen($data) < $datalen) {
                                // test for the case that the payload has been compressed twice
                                $this->debug('The inflated payload is smaller than the gzipped one; try again');
                                if ($degzdata = @gzinflate($data)) {
                                    $data = $degzdata;
                                    $this->debug('The payload has been inflated again to ' . strlen($data) . ' bytes');
                                }
                            }
                        } else {
                            $this->debug('Error using gzinflate to inflate the payload');
                            $this->setError('Error using gzinflate to inflate the payload');
                        }
                    } elseif ($this->incoming_headers['content-encoding'] == 'gzip') {
                        if ($degzdata = @gzinflate(substr($data, 10))) {    // do our best
                            $data = $degzdata;
                            $this->debug('The payload has been un-gzipped to ' . strlen($data) . ' bytes');
                            if (strlen($data) < $datalen) {
                                // test for the case that the payload has been compressed twice
                                $this->debug('The un-gzipped payload is smaller than the gzipped one; try again');
                                if ($degzdata = @gzinflate(substr($data, 10))) {
                                    $data = $degzdata;
                                    $this->debug('The payload has been un-gzipped again to ' . strlen($data) . ' bytes');
                                }
                            }
                        } else {
                            $this->debug('Error using gzinflate to un-gzip the payload');
                            $this->setError('Error using gzinflate to un-gzip the payload');
                        }
                    }
                    //$timer->setMarker('finished decoding of gzip/deflated content');
                    //print "<xmp>\nde-inflated:\n---------------\n$data\n-------------\n</xmp>";
                    // set decoded payload
                    $this->incoming_payload = $header_data . $lb . $lb . $data;
                } else {
                    $this->debug('The server sent compressed data. Your php install must have the Zlib extension compiled in to support this.');
                    $this->setError('The server sent compressed data. Your php install must have the Zlib extension compiled in to support this.');
                }
            } else {
                $this->debug('Unsupported Content-Encoding ' . $this->incoming_headers['content-encoding']);
                $this->setError('Unsupported Content-Encoding ' . $this->incoming_headers['content-encoding']);
            }
        } else {
            $this->debug('No Content-Encoding header');
        }

        if (strlen($data) == 0) {
            $this->debug('no data after headers!');
            $this->setError('no data present after HTTP headers');

            return FALSE;
        }

        return $data;
    }
382764
public function get()
    {
        $this->verifyRefreshTokenExists();

        $token = $this->storage->get('refresh_token');

        return $this->encryptor->decrypt($token);
    }
488551
public RFuture<String> get(String url) {
    return req(url).execute().map(GET_PAYLOAD);
  }
843277
public function getParams($name=NULL) {
		if(!isset($this->payload['params'])) {
			return NULL;
		}
		$params = $this->payload['params'];
		if(isset($name)) {
			if(isset($params[$name])) {
				return $params[$name];
			}
		} else {
			return $params;
		}
		return NULL;
	}