@param string $path
@param string $method

@return Parameter|null
542864
public function getRequestBodyParameter(string $path, string $method)
    {
        foreach ($this->getPath($path)->getOperation($method)->getParameters() as $parameter) {
            if ($parameter->getIn() === Parameter::IN_BODY) {
                return $parameter;
            }
        }

        return null;
    }
1252433
protected function performRequest($method, $path, array $params)
	{
		/* Combine given parameters with persistent parameters and convert to string values. */
		$params = array_map('strval', $params + $this->persistent_params);

		$params = $this->signRequest($path, $params, $this->getAppSecret());
		$result = $this->doRequest($method, $path, $params);

		$this->logRequest($method, $path, $params, $result);

        /* See if there were cURL errors */
        if (empty($result["body"])) {
            throw new Mollie_Exception($result["message"], $result["code"]);
        }
        $object = $this->convertResponseBodyToObject($result['body'], $result['content_type']);

        if ($object instanceof Mollie_Response) {
            $this->checkResultErrors($object);
        }

        return $object;
    }
764524
public function findFromPath($path, $method = null)
    {
        foreach ($this->getRoutes() as $route) {
            if ($matchedRoute = $route->matches($path, $method)) {
                return $matchedRoute;
            }
        }
        return null;
    }
927037
public function setPath($path, $value = null, $method = null)
    {
        $this->paths[$path] = [];

        if (! is_null($value)) {
            $this->paths[$path]['path'] = $value;
        }

        if (! is_null($method)) {
            $this->paths[$path]['method'] = $method;
        }
    }
228813
protected function runRequest($path, $method = 'GET', $data = '')
    {
        $curl = $this->prepareRequest($path, $method, $data);

        $response = curl_exec($curl);
        $this->responseCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
        $contentType = curl_getinfo($curl, CURLINFO_CONTENT_TYPE);

        if (curl_errno($curl)) {
            $e = new \Exception(curl_error($curl), curl_errno($curl));
            curl_close($curl);
            throw $e;
        }
        curl_close($curl);

        return $this->processCurlResponse($response, $contentType);
    }
308548
public function resolve( $path, $method = "GET", $strict = TRUE ){
		return $this->resolver->resolve( $path, $method, $strict );
	}
1016212
protected function _restserver($path, $method = 'GET', $params = array(), $getParams = array()) {
        $this->container = null;
        if ($this->debug) { $start = microtime(true); }
        if (is_array($method) && empty($params)) {
            $params = $method;
            $method = 'GET';
        }
        $getParams['method'] = $method; // method override as we always do a POST
        $uri = $this->getUrl('api', $path);
        $result = $this->_oauthRequest($uri, $params, $getParams);

        if (floatval($this->api_version) >= 2) {
            $container = json_decode($result, true);
            if ($container && array_key_exists('name', $container) && $container['name'] == 'SPP Container') {
                $this->container = $container;
            }
        }

        preg_match("/\.(json|jsonp|html|xml|serialize|php|csv|tgz)$/", $path, $matches);
        if ($matches) {
            switch ($matches[1]) {
                case 'json':
                    $result = json_decode($result, true);
                    break;
                default:
                    if ($this->debug) { $this->timer[__FUNCTION__]['elapsed'][] = microtime(true)-$start; }
                    return $result;
                    break;
            }
        } else
            $result = json_decode($result, true);

        // results are returned, errors are thrown
        if (is_array($result) && isset($result['error']) && $result['error']) {
            $e = new VGS_Client_Exception($result, $this->raw);
            switch ($e->getType()) {
                case 'ApiException':
                    break;
                // OAuth 2.0 Draft 00 style
                case 'OAuthException':
                    // OAuth 2.0 Draft 10 style
                case 'invalid_token':
                    $this->setSession(null);
            }
            throw $e;
        }
        if (floatval($this->api_version) >= 2 && $result && is_array($result) && array_key_exists('name', $result) && $result['name'] == 'SPP Container') {
            if (isset($result['sig']) && isset($result['algorithm'])) {
                $result = $this->validateAndDecodeSignedRequest($result['sig'], $result['data'], $result['algorithm']);
            } else {
                $result = $result['data'];
            }
        }
        if ($this->debug) { $this->timer[__FUNCTION__]['elapsed'][] = microtime(true)-$start; }
        return $result;
    }
1315105
public function getByMethod($method = null)
    {
        if (is_null($method)) {
            return $this->getRoutes();
        }

        // Filter routes by the given method
        return ArrayHelper::get($this->routes, $method, []);
    }
204203
public function requestPath($path, $method = null) {
        $this->setRequestPath($path);

        if (null === $method) {
            $this->setRequestMethod('GET', false);
        } else {
            $this->setRequestMethod($method);
        }

        return $this->sendRequest();
    }
1263853
public function getRequest($method, $path, $parameters = [], $authenticated = true)
    {
        $request = $this->createRequest($method, $path, $parameters);

        if ($authenticated) {
            $request = $this->authenticateRequest($request);
        }

        return $request;
    }
62814
public function send(string $method, array $path = []): DorcasResponse
    {
        return $this->httpSend($method, $this->sdk->getHttpClient(), $path);
    }
598351
final public function get($method = null) {

        if ( empty($method) ) {

            $return = $this->rpc_methods;

        } else if ( array_key_exists($method, $this->rpc_methods) ) {

            $return = $this->rpc_methods[$method];

        } else {

            $return = null;

        }

        return $return;

    }
198517
private function request($path, $method, $headers = null, $body = null){
	        $ch  = curl_init($path);

	        $_headers = array('Expect:');
	        if (!is_null($headers) && is_array($headers)){
	            foreach($headers as $k => $v) {
	                array_push($_headers, "{$k}: {$v}");
	            }
	        }

	        $length = 0;
			$date   = gmdate('D, d M Y H:i:s \G\M\T');

	        if (!is_null($body)) {
	            if(is_resource($body)){
	                fseek($body, 0, SEEK_END);
	                $length = ftell($body);
	                fseek($body, 0);

	                array_push($_headers, "Content-Length: {$length}");
	                curl_setopt($ch, CURLOPT_INFILE, $body);
	                curl_setopt($ch, CURLOPT_INFILESIZE, $length);
	            } else {
	                $length = @strlen($body);
	                array_push($_headers, "Content-Length: {$length}");
	                curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
	            }
	        } else {
	            array_push($_headers, "Content-Length: {$length}");
	        }

	        // array_push($_headers, 'Authorization: ' . $this->sign($method, $uri, $date, $length));
	        array_push($_headers, "Date: {$date}");

	        curl_setopt($ch, CURLOPT_HTTPHEADER, $_headers);
	        curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout);
	        curl_setopt($ch, CURLOPT_HEADER, 1);
	        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
			curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);

	        if ($method == 'PUT' || $method == 'POST') {
				curl_setopt($ch, CURLOPT_POST, 1);
	        } else {
				curl_setopt($ch, CURLOPT_POST, 0);
	        }

	        if ($method == 'HEAD') {
	            curl_setopt($ch, CURLOPT_NOBODY, true);
	        }

	        $response = curl_exec($ch);
	        $status   = curl_getinfo($ch, CURLINFO_HTTP_CODE);
	        curl_close($ch);
	        list($header, $body) = explode("\r\n\r\n", $response, 2);
	        if ($status == 200) {
	            if ($method == 'GET') {
	                return $body;
	            } else {
	                return $this->response($response);
	            }
	        } else {
	            $this->error($header , $body);
	            return false;
	        }
	    }
516685
protected function doRequest($method, $path, array $params)
	{
		$ch = curl_init();

		curl_setopt($ch, CURLOPT_HEADER, false);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
		curl_setopt($ch, CURLOPT_TIMEOUT, 20);
		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, self::STRICT_SSL);
		curl_setopt($ch, CURLOPT_ENCODING, ''); // Signal that we support gzip

		$api_endpoint = trim($this->api_base_url, '/').'/'.trim($path, '/');

		if ($method == self::METHOD_GET) {
			curl_setopt($ch, CURLOPT_URL, $api_endpoint.'?'.http_build_query($params, '', '&'));
		} else {
			curl_setopt($ch, CURLOPT_URL, $api_endpoint);
			curl_setopt($ch, CURLOPT_POST, true);
			curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
		}

		$body = curl_exec($ch);

        /* 77 = CURLE_SSL_CACERT_BADFILE (constant not defined in PHP though). */
		if (curl_errno($ch) == CURLE_SSL_CACERT || curl_errno($ch) == CURLE_SSL_PEER_CERTIFICATE || curl_errno($ch) == 77) {
			/*
			 * On some servers, the list of installed certificates is outdated or not present at all (the ca-bundle.crt
			 * is not installed). So we tell cURL which certificates we trust. Then we retry the requests.
			 */
			curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__) . DIRECTORY_SEPARATOR . "cacert.pem");
			$body = curl_exec($ch);
		}

		if (strpos(curl_error($ch), "certificate subject name 'mollie.nl' does not match target host") !== false) {
			/*
			 * On some servers, the wildcard SSL certificate is not processed correctly. This happens with OpenSSL 0.9.7
			 * from 2003.
			 */
			curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
			$body = curl_exec($ch);
		}

		$results = [
			'body'         => $body,
			'http_code'    => curl_getinfo($ch, CURLINFO_HTTP_CODE),
			'content_type' => curl_getinfo($ch, CURLINFO_CONTENT_TYPE),
			'code'         => curl_errno($ch), 
			'message'      => curl_error($ch),
		];

		curl_close($ch);

		return $results;
	}
1276730
public static function getResponse(
    $method,
    $path,
    RequestOptions $options = null
  )
  {
    $instance = static::getInstance();

    if ($options)
    {
      // Get via HTTP
      if (isset($instance->url) && $options->isHttp())
      {
        return $instance->getHTTPResponse($method, $path, $options);
      }
    }

    // Get from the internal call if available
    if (isset($instance->app))
    {
      return $instance->getRawResponse($method, $path, $options);
    }

    // todo better exception message with link
    throw new Exception(
      'No app configured for internal calls,
          and no URL supplied for HTTP based calls'
    );
  }
510864
public function getUriRouteFor(string $method): ?Route
    {
        if (!$this->isMethodAllowed($method)) {
            return null;
        }

        return $this->uriRoutes[$method];
    }
1171628
public function match($path, $method = Route::METHOD_ALL)
    {
        if ($this->router->hasStatic($path, $method)) {
            return new Match($this->router->getStaticByURI($path, $method));
        }

        return $this->matchVariableRoutes($path, $method);
    }