Processes the payload POST data and sets up the array of requests.
@param string $service The service being requested.
@param string $verb The HTTP verb being used.
@param array|object $post The raw POST data.
5879
private function processPayload($service, $verb, $post)
    {
        $this->batch = is_array($post);
        if (false === $this->batch) {
            $post = array($post);
        }
        $this->requests = array_map(function ($payload) use ($service, $verb) {
            return new JsonRpcRequest($service, $payload, $verb);
        }, $post);
    }
519046
public ApiResponse postUserActivity(String verb, String title,
            String content, String category, User user, Entity object,
            String objectType, String objectName, String objectContent) {
        Activity activity = Activity.newActivity(verb, title, content,
                category, user, object, objectType, objectName, objectContent);
        return postUserActivity(user.getUuid().toString(), activity);
    }
351013
protected function sendRequest(
        $verb,
        $endpoint,
        $data = null,
        array $queryStringParams = null
    ) {
        try {
            $queryString = $this->buildQueryString($queryStringParams);
            $request = curl_init($this->serviceUrl . $endpoint . $queryString);

            $this->headers = array_merge($this->headers, [
                'Content-Type' => sprintf('%s', $this->contentType),
                'Content-Length' => $data === null ? 0 : strlen($data),
            ]);

            $headers = [];
            foreach ($this->headers as $key => $value) {
                $headers[] = $key . ': '. $value;
            }

            curl_setopt($request, CURLOPT_CONNECTTIMEOUT, $this->timeout);
            curl_setopt($request, CURLOPT_TIMEOUT, $this->timeout);
            curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($request, CURLOPT_SSL_VERIFYPEER, false); //true,);
            curl_setopt($request, CURLOPT_SSL_VERIFYHOST, false); //2,);
            curl_setopt($request, CURLOPT_CUSTOMREQUEST, strtoupper($verb));
            curl_setopt($request, CURLOPT_POSTFIELDS, $data);
            curl_setopt($request, CURLOPT_HTTPHEADER, $headers);
            curl_setopt($request, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS);
            // curl_setopt($request, CURLOPT_VERBOSE, true);
            curl_setopt($request, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);

            if (
                $this->curlOptions != null
                && !empty($this->curlOptions)
            ) {
                curl_setopt_array($request, $this->curlOptions);
            }

            $curlResponse = curl_exec($request);
            $curlInfo = curl_getinfo($request);
            $curlError = curl_errno($request);

            $response = new GatewayResponse();
            $response->statusCode = $curlInfo['http_code'];
            $response->rawResponse = $curlResponse;
            return $response;
        } catch (\Exception $e) {
            throw new \Exception(
                "Error occurred while communicating with gateway.",
                $e->getCode(),
                $e
            );
        }
    }
1242401
protected function sendApiCall($verb, $location)
    {
        try {
            return parent::sendApiCall($verb, $location);
        } catch (EntityException $exception) {
            if (BackupCode\Exception::isBackupCodeException($exception)) {
                throw new BackupCode\Exception($exception);
            }

            throw $exception;
        }
    }
1022502
protected static function add(string $verb, string $path, $handler) : Route
    {
        /** @var Router $router */
        $router = static::getRouterInstance();

        $route = new static($router, $verb, $path, $handler);

        Router::addRoute($verb, $route);

        return $route;
    }
566191
public function onPostSerialize(ObjectEvent $event)
    {
        if ($this->container->has('routing')) {
            $uri = $this->container->get('routing')->getUri($event->getObject()->getUrl());
            $event->getVisitor()->addData('uri', $uri);
        }
    }
702309
protected function handlePayload(Request $request, Response $response, Payload $payload): Response
    {
        $handler = $this->getHandler($request);

        return $response
            ->withBody(Factory::newStream($handler->body($payload)))
            ->withHeader('Content-Type', $handler->type())
            ->withStatus($payload->getCode())
        ;
    }
593798
public function request($verb, $params = [])
    {
        $xml = $this->getOaiResponse($verb, $params);
        return $this->responseProcessor
            ? $this->responseProcessor->process($xml) : $xml;
    }
481328
public function sendRequest($verb, $path, $body = null)
    {
        $this->logger->info('Module: ' . __CLASS__);

        if ($body instanceof Model) {
            $body = $body->toJSON(true);
        }

        $headers = [
            'Authorization' => 'ApiKey ' . $this->config->apiKey,
            'Request-ID' => uniqid('api-request-'),
            'Content-Type' => 'application/json',
        ];

        $this->logger->info('HTTP Request: ' . strtoupper($verb) . ' ' . $this->config->apiEndpoint . $path);
        $this->logger->debug("Request Headers:\n" . print_r($headers, true));

        if (isset($body)) {
            $this->logger->debug("Request Body:\n" . $body);
        }

        $response = $this->http->request(strtoupper($verb), trim($this->config->apiEndpoint . $path), [
            'body' => $body,
            'headers' => $headers
        ]);

        $this->logger->info('HTTP Code: ' . $response->getStatusCode());

        return $response->getBody()->getContents();
    }
722002
function ( uri, verb ) {
		if ( string.isEmpty( uri ) || string.isEmpty( verb ) ) {
			throw new Error( label.error.invalidArguments );
		}

		uri        = utility.parse( uri ).href;
		verb       = verb.toLowerCase();
		var result = false,
		    bit    = 0;

		if ( !cache.get( uri, false ) ) {
			result = undefined;
		}
		else {
			if ( regex.del.test( verb ) ) {
				bit = 1;
			}
			else if ( regex.get_headers.test( verb ) ) {
				bit = 4;
			}
			else if ( regex.put_post.test( verb ) ) {
				bit = 2;
			}
			else if ( regex.patch.test( verb ) ) {
				bit = 8;
			}

			result = Boolean( client.permissions( uri, verb ).bit & bit );
		}

		return result;
	}
470191
protected function sendRequest($verb, $params)
    {
        // Set up the request:
        $this->client->resetParameters(false, false); // keep cookies/auth
        $this->client->setUri($this->baseUrl);

        // Load request parameters:
        $query = $this->client->getRequest()->getQuery();
        $query->set('verb', $verb);
        foreach ($params as $key => $value) {
            $query->set($key, $value);
        }

        // Perform request:
        return $this->client->setMethod('GET')->send();
    }
398503
function postback(payload, callback)
{
  if (typeof payload.payload == 'string')
  {
    payload.payload = JSON.parse(payload.payload);
  }

  callback(null, payload);
}
265267
protected function doTransaction(
        $verb,
        $endpoint,
        $data = null,
        array $queryStringParams = null
    ) {
        $response = $this->sendRequest($verb, $endpoint, $data, $queryStringParams);

        if (!in_array($response->statusCode, [200, 204])) {
            $parsed = json_decode($response->rawResponse);
            $error = isset($parsed->error) ? $parsed->error : $parsed;
            throw new GatewayException(
                sprintf(
                    'Status Code: %s - %s',
                    $response->statusCode,
                    isset($error->message) ? $error->message : (string) $error
                )
            );
        }

        return $response->rawResponse;
    }
716818
public function postUpdate($object): void
    {
        /** @var BlockAdmin $block */
        $blockManager = $this->blockManager;

        $block = $blockManager->get($object);
        $block->postUpdate($object);

        $service = $blockManager->get($object);

        $this->cacheManager->invalidate($service->getCacheKeys($object));
    }
838438
protected function createRequest($verb, $uri, $parameters)
    {
        $parameters = \array_merge($this->parameters, (array) $parameters);

        $uri = $this->addPrefixToUri($uri);

        // If the URI does not have a scheme then we can assume that there it is not an
        // absolute URI, in this case we'll prefix the root requests path to the URI.
        $rootUrl = $this->getRootRequest()->root();

        if ((! \parse_url($uri, PHP_URL_SCHEME)) && \parse_url($rootUrl) !== false) {
            $uri = \rtrim($rootUrl, '/').'/'.ltrim($uri, '/');
        }

        $request = InternalRequest::create(
            $uri,
            $verb,
            $parameters,
            $this->cookies,
            $this->uploads,
            $this->container['request']->server->all(),
            $this->content
        );

        $request->headers->set('host', $this->getDomain());

        foreach ($this->headers as $header => $value) {
            $request->headers->set($header, $value);
        }

        $request->headers->set('accept', $this->getAcceptHeader());

        return $request;
    }
788599
public function methodIs($verb)
    {

        $method = $this->getVerb();
        $return = ($method === strtolower($verb)) ? true : false;

        return $return;
    }
1250033
public function request($verb, $path, $accept, array $customCURLOptions=[])
    {

        $verb = strtoupper(
            trim(
                $verb
            )
        );

        $instantiateClass = "\\Lamoni\\RESTLyte\\RESTLyteRequest\\RESTLyteRequest{$this->getResponseType()}";

        $request = new $instantiateClass(
            $this->getServer(),
            $verb,
            $path,
            $this->getAuthCredentials(),
            $accept,
            $this->getVerifySSLPeer(),
            $this->getHTTPHeaders(),
            $customCURLOptions
        );

        return $request->getResponse();
    }