Takes a URL and a key=>value array to generate a POST PSR-7 request object

@param string $url The URL to make a request to
@param array $params Key=>Value array of data to send
@return \Psr\Http\Message\ResponseInterface
962845
public function post($url, array $params)
    {
        $request = new Request(
            $url,
            'POST',
            'php://temp',
            ['content-type' => 'application/json']
        );

        $request->getBody()->write(json_encode($params));
        return $this->send($request);
    }
700168
public function curlPost($url, array $params = [], array $opts = [])
    {
        $options = [
            CURLOPT_POST    => true,
            CURLOPT_URL     => $url,
        ];
        foreach ($opts as $key => $value) {
            if ($key !== CURLOPT_POST && $key !== CURLOPT_URL) {
                $options[$key] = $value;
            }
        }
        if (!array_key_exists(CURLOPT_POSTFIELDS, $options)) {
            $options[CURLOPT_POSTFIELDS] = $this->params($params);
        }

        return self::curl($options);
    }
720353
public function httpPostRequest($url, $parameters)
    {
        if (empty($this->client)) {
            $this->client = new Client(['verify' => false]);
        }

        $this->response = $this->client->request(
            'POST',
            $url,
            [
                'headers' => $this->getHeaders(),
                'json' => $parameters
            ]
        );
        $response = json_decode($this->response->getBody());

        return $response;
    }
931542
private function buildQueryUrl($params)
    {
        $url = parse_url($_SERVER['REQUEST_URI']);
        if (! array_key_exists('query', $url)) {
            $url['query'] = '';
        }
        parse_str($url['query'], $url['query']);
        if (! is_array($url['query'])) {
            $url['query'] = array();
        }
        // Remove 'start parameter if it exists
        if (array_key_exists('start', $url['query'])) {
            unset($url['query']['start']);
        }
        // Add extra parameters from argument
        $url['query'] = array_merge($url['query'], $params);
        $url['query'] = http_build_query($url['query']);
        $url = $url['path'] . ($url['query'] ? '?'.$url['query'] : '');
        
        return $url;
    }
682702
public function request($method, $url, array $params = [])
    {
        if (!$this->authenticated()) {
            $this->authenticate();
        }

        if (!isset($params['query'])) {
            $params['query'] = [];
        }

        $params['query']['format'] = 'json';

        try {
            $response = $this->getHttpClient()->request($method, $url, $params);
        } catch (RequestException $e) {
            return $e->getResponse();
        }

        return $response;
    }
1160907
static public function secureUrlCached($url, $params = []) {
        if (is_array($url)) {
            $url = implode("/", $url);
        }
        $cacheKey = Cached::keymaker(__METHOD__, $url, $params);
        $cached = new Cached($cacheKey);
        if (!$cached->exists()) {
            $result = self::secureUrl($url, $params);
            syslog(LOG_INFO, "Returned " . count($result) . " rows.");
            $cached->set($result);
        }
        return $cached->get();
    }
430421
public static function put($url, $params) {
        $self = new self();
        if ( is_array($params) ) {
            $params = StringUtils::jsonEncode($params);
        }
        $curl = $self->_curlInit($url, array('Content-Type' => 'application/json'));
        curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PUT");
        curl_setopt($curl, CURLOPT_POSTFIELDS, $params);

        return $self->_doRequest($curl, false);
    }
150866
public function post($url, $params = array(), $options = array())
    {
        return $this->request($url, self::POST, $params, $options);
    }
595368
public function get($url, $params = array())
    {
        $request = $this->provider->request($url, $params);
        $response = $this->client->send($request);

        $data = $response->getBody()->getContents();
        $format = $this->getFormat($params, $response);

        return $this->serializer->deserialize($data, null, $format);
    }
535134
public function request($url, array $params = array())
    {
        if (false === $provider = $this->resolver->resolve($url, $params)) {
            throw new \RuntimeException();
        }

        return $provider->request($url, $params);
    }
1173181
public function get($url, array $params = [])
    {
       $queryString = '?' . http_build_query($params);

       $url = $url . $queryString;

       $request = new Request(
            $url,
            'GET'
        );

        return $this->send($request);
    }
236431
public function makeRequest($url, $params)
    {
        $http = new HttpClient('https://api.github.com');
        $res = $http->get($url, $params);

        return $res['body'];
    }
711407
public function execGET($url, array $params = [])
    {
        $url = $this->baseUrl . $url;

        // Build the query from the parameters
        if ($params !== []) {
            $url .= '?' . http_build_query($params);
        }

        // Set request options
        $this->addOptions([
            CURLOPT_URL => $url,
            CURLOPT_HTTPGET => true,
        ]);

        return $this->exec();
    }
768351
public function composeUrl($url, array $params = [])
    {
        if (strpos($url, '?') === false) {
            $url .= '?';
        } else {
            $url .= '&';
        }
        $url .= http_build_query($params, '', '&', PHP_QUERY_RFC3986);
        return $url;
    }
1187826
protected function postRequest($url, $parameters = [])
    {
        if (!empty($parameters)) {
            $this->parameters->addPost($parameters);
        }

        return $this->request($url);
    }
1303583
public function delete($url, array $params = [])
    {
        return $this->request($this->createUrl($url), self::METHOD_DELETE, $params);
    }
578940
public function postForm($url, array $params = [], $timeout = null)
    {
        $body = $this->createQueryString($params);
        return $this->post($url, $body, \Zend\Http\Client::ENC_URLENCODED, $timeout);
    }