Retrieves http response for a request with the post method.

@param  string $path
@param  array  $parameters

@return object
336366
public function post($path, $parameters)
    {
        $request = $this->getRequest(static::HTTP_POST, $path, $parameters);

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

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

        return $request;
    }
1058020
public function retrieveData($path, array $params = array(), array $opts = array())
    {
        return empty($params)
            ? $this->_processResponse($this->http->get($this->_getApiPath($opts) . $path))
            : $this->_processResponse(
                $this->http->get($this->_getApiPath($opts) . $path . "?" . http_build_query($params, '', '&'))
            );
    }
547942
public function post($url, $parameters = [])
    {
        $url = static::LOCATION.$url;
        $headers = $this->buildHeaders();

        $request = $this->requestProvider->createRequest('POST', $url, $headers, json_encode($parameters));
        $response = $this->client->send($request);

        $this->errorCheckResponse($response);

        return json_decode($this->streamToString($response->getBody()));
    }
1328613
public function request(string $path, array $params = null, string $method = null, $body = null, array $headers = null):ResponseInterface{

		$request = $this->requestFactory
			->createRequest($method ?? 'GET', Psr7\merge_query($this->apiURL.$path, $params ?? []));

		foreach(array_merge($this->apiHeaders, $headers ?? []) as $header => $value){
			$request = $request->withAddedHeader($header, $value);
		}

		if(is_array($body) && $request->hasHeader('content-type')){
			$contentType = strtolower($request->getHeaderLine('content-type'));

			// @todo: content type support
			if($contentType === 'application/x-www-form-urlencoded'){
				$body = $this->streamFactory->createStream(http_build_query($body, '', '&', PHP_QUERY_RFC1738));
			}
			elseif($contentType === 'application/json'){
				$body = $this->streamFactory->createStream(json_encode($body));
			}

		}

		if($body instanceof StreamInterface){
			$request = $request
				->withBody($body)
				->withHeader('Content-length', $body->getSize())
			;
		}

		return $this->sendRequest($request);
	}
198699
function get($path, $query = null, $headers = null, $curlOpts = null) {
        $payload = $this -> encodePostBody($query);
        
        if ($payload !== "") {
            if (strpos($path, '?')) {
                $url = $path . "&" . $payload;
            } else {
                $url = $path . "?" . $payload;
            }
        }else{
            $url = $path;
        }
        
        return $this -> request($url, self::HTTP_GET, '', $headers, $curlOpts);
    }
84197
protected function doGet(string $path, array $parameters = [], array $headers = [])
    {
        if (0 < \count($parameters)) {
            $path .= '?'.\http_build_query($parameters);
        }

        $request = $this
            ->getInstapushClient()
            ->getRequestFactory()
            ->createRequest('GET', $path, $headers);

        $this->setRequest($request);

        $response = $this
            ->getInstapushClient()
            ->getHttpClient()
            ->sendRequest($request);

        $this->setResponse($response);

        return $this;
    }
1110625
public function get(string $path, array $parameters = [], array $requestHeaders = []): ResponseInterface
    {
        if (count($parameters) > 0) {
            $path .= '?' . http_build_query($parameters);
        }

        $response = $this->httpClient->sendRequest(
            $this->requestBuilder->create('GET', $path, $requestHeaders)
        );

        $statusCode = $response->getStatusCode();
        if ($statusCode !== 200) {
            $errorResponse = $response->getBody()->__toString();
            $errorMessage = !empty($errorResponse) ? $errorResponse : "Invalid Auspost API response.";

            throw new EndpointServiceError($errorMessage);
        }

        return $response;
    }
1313895
public function get($path, array $options = array())
    {
        $client = $this->createGuzzleClient($this->consumerKey, $this->consumerSecret);

        $options['auth'] = 'oauth';

        try {
            return json_decode($client->get('/1.1'.$path, $options)->getBody(), true);
        } catch (GuzzleRequestException $e) {
            $message = $e->getMessage();

            if ($e->hasResponse()) {
                $responseData = json_decode($e->getResponse()->getBody(), true);

                $messageParts = array();

                foreach ($responseData['errors'] as $error) {
                    $messageParts[] = $error['message'];
                }

                $message = implode($messageParts, "\n");
            }

            throw new RequestException($message);
        }
    }
69237
protected function buildApiUrl(string $path, array $parameters): string
    {
        $parameters = array_merge([
            'access_token' => $this->accessToken,
        ], $parameters);

        $query = http_build_query($parameters, '', '&');

        return 'https://api.instagram.com/v1/'.$path.'?'.$query;
    }
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;
    }
169702
public function put($path, $params)
    {
        $response = $this->http_client->request('PUT', $path, $params);
        $this->handleErrors($response);
        return $response;
    }
1355778
protected function httpDelete(string $path, array $params = [], array $requestHeaders = []): ResponseInterface
    {
        return $this->httpClient->sendRequest(
            $this->requestBuilder->create('DELETE', $path, $requestHeaders, $this->createJsonBody($params))
        );
    }
304227
public function redirectToPath($path, $parameters = array())
    {
        $route = $this->getRouter()->generate($path, $parameters);

        return $this->redirect($route);
    }
116161
protected function httpGet(string $path, array $params = [], array $requestHeaders = []): ResponseInterface
    {
        if (count($params) > 0) {
            $path .= '?'.http_build_query($params);
        }

        return $this->httpClient->sendRequest(
            $this->requestBuilder->create('GET', $path, $requestHeaders)
        );
    }
496224
public function request($path, $body = null, $httpMethod = 'GET', array $options = array())
    {
        $headers = array();

        $options = array_merge($this->options, $options);

        if (isset($options['headers'])) {
            $headers = $options['headers'];
            unset($options['headers']);
        }

        $headers = array_merge($this->headers, array_change_key_case($headers));

        unset($options['body']);

        unset($options['base']);
        unset($options['user_agent']);

        $request = $this->createRequest($httpMethod, $path, null, $headers, $options);

        if ($httpMethod != 'GET') {
            $request = $this->setBody($request, $body, $options);
        }

        try {
            $response = $this->client->send($request);
        } catch (\LogicException $e) {
            throw new \ErrorException($e->getMessage());
        } catch (\RuntimeException $e) {
            throw new \RuntimeException($e->getMessage());
        }

        return new Response($this->getBody($response), $response->getStatusCode(), $response->getHeaders());
    }
458884
public function delete($path, $params = array()) {
    $request = $this->request();
    $request = $this->prepareRequest($request);

    $response = $request->delete($this->endpoint . $path, $params);
    return $this->handleResponse($response);
  }