Build up the request to the gateway
@param string $uri endpoint to be used
@param array $param payload param
@param boolean $state if error occured don't send charge
@return CheckoutApi_Lib_RespondObj
@throws Exception
172233
public function request($uri,array $param, $state)
    {

        /** @var CheckoutApi_Lib_RespondObj $respond */
        $respond = CheckoutApi_Lib_Factory::getSingletonInstance('CheckoutApi_Lib_RespondObj');
        $this->setConfig($param);

        if(!isset($param['postedParam'])) {

            $param['postedParam'] = array();
        }
        $param['rawpostedParam'] = $param['postedParam'];
        $param['postedParam'] = $this->getParser()->preparePosted($param['postedParam']);

        $respondArray = null;

        if($state){
            $headers = $this->initHeader();
            $param['headers'] = $headers;

            /** @var CheckoutApi_Client_Adapter_Abstract $adapter */
            $adapter =  $this->getAdapter($this->getProcessType(),array('uri'=>$uri,'config'=>$param));

            if($adapter){
                $adapter->connect();
                $respondString = $adapter->request()->getRespond();
                $statusResponse = $adapter->getResourceInfo();
                $this->getParser()->setResourceInfo($statusResponse);
                $respond = $this->getParser()->parseToObj($respondString);

                if($respond && isset($respond['errors'])  && $respond->hasErrors()  ) {

                    /** @var CheckoutApi_Lib_ExceptionState  $exceptionStateObj */
                    $exceptionStateObj = $respond->getExceptionState();
                    $errors = $respond->getErrors()->toArray();
                    $exceptionStateObj->flushState();

                    foreach( $errors as $error) {
                        $this->throwException($error, $respond->getErrors()->toArray());
                    }
                }elseif( $respond && isset($respond['errorCode']) && $respond->hasErrorCode()) {
                    /** @var CheckoutApi_Lib_ExceptionState  $exceptionStateObj */
                    $exceptionStateObj = $respond->getExceptionState();

                    $this->throwException($respond->getMessage(),$respond->toArray() );

                }elseif($respond && $respond->getHttpStatus()!='200') {
                    $this->throwException('Gateway is temporary down',$param );
                }

                $adapter->close();
            }

        }

        return $respond;
    }
382403
public function post(string $uri, array $data = [], string $payload = null)
    {
        $request = $this->getRequest($uri)
            ->setMethod('POST')
            ->setPosts($data)
            ->setPayload($payload)
        ;

        return $this->send($request);
    }
1102054
public function put($uri, $action)
    {
        $uri = $this->buildUri($uri);

        return $this->addResponseType(Route::put($uri, $action));
    }
121345
public static void setRequestUri(URI baseUri, URI requestUri) throws IllegalStateException {
        getRequest().setRequestUri(baseUri, requestUri);
    }
1303138
public String post(String url, String payload) throws AuthenticationException, ApiException {
		return performRequest(url, "POST", null, null, payload);
	}
365744
public function post($uri, $body = null, array $options = [])
    {
        return $this->request(self::REQUEST_METHOD_POST, $uri, $body, $options);
    }
193017
public static function post($uri, $payload = null, $mime = null)
    {
        return self::init(Http::POST)->uri($uri)->body($payload, $mime);
    }
37170
public RFuture<String> post(String url, String data) {
    return req(url).setPayload(data).execute().map(GET_PAYLOAD);
  }
1115562
protected function performRequest(string $uri)
    {
        $httpResponse = $this->client->get($uri);
        Assert::eq($httpResponse->getStatusCode(), 200, 'Request failed.');

        $content = $httpResponse->getBody()->getContents();
        $xml = simplexml_load_string($content);

        $this->exceptionOnError($xml);

        return $this->responseFactory->getResponse($xml);
    }
521776
private function handleOnStateWasSet(State $state, Payload $payload)
    {
        while ($state->hasEvent(self::ON_STATE_WAS_SET)) {
            $newState = $state->triggerEvent(self::ON_STATE_WAS_SET, $payload);
            if ($newState === null) {
                break;
            }

            $state = $this->process->state($newState);
            $this->updatePayload($state, $payload);
        }
    }
818704
public function get($uri, array $params = array())
    {

        $uri .= '?' . http_build_query($params);
        return $this->client->get($uri);

    }
896508
function POST(uri, params) {
	var form = new FormData();

	for (var i in params) {
		form.append(i, params[i]);
	}

	const requestURL = `${uri}`;
	log(`request URL: ${requestURL}`);

	return fetch(requestURL, { method: 'POST', compress: compress, body: form, headers: { 'Content-Type': 'multipart/form-data; boundary='+form.getBoundary() } })
    .then(function handleRequest(res) {
			const status = res.status;
			if (status != 200) {
				const error = new Error(`Request failed: ${status}`);
				error.status = status;
				throw error;
			}
			return res.json();
		})
		.catch(error => {
			log(`error: ${error}`);
			throw error;
		});
}
636953
def _make_post_request(self, uri, payload, timeout=None):
        
        if not timeout:
            timeout = self.timeout
        return self._make_request(requests.post, uri, data=payload, timeout=timeout)
350990
public function redirect($uri, int $status = 301): ResponseInterface
    {
        if (!\is_string($uri) && !$uri instanceof UriInterface) {
            throw new \InvalidArgumentException('Uri MUST be a string or Psr\Http\Message\UriInterface instance; received "' .
                (\is_object($uri) ? \get_class($uri) : \gettype($uri)) . '"');
        }

        $this->header->set('Location', (string) $uri);

        return $this->empty($status);
    }
347039
public function performApiRequest($endpoint, $payload)
    {
        $this->setupRequest($payload);
        $this->apiEndpoint = $endpoint;

        return $this->doDropboxApiRequest();
    }
18066
public function get($uri, array $params = array())
    {

        $uri .= '?' . http_build_query($params);

        $ch = $this->initCurlHandler($uri);
        return $this->makeRequest($ch);

    }
1020838
public static UriBuilder fromUri(Uri uri) throws IllegalArgumentException {
        if (uri == null)
            throw new IllegalArgumentException("Uri cannot be null");

        UriBuilder b = newInstance();
        b.uri(uri);
        return b;
    }