Send a POST request.

@author yansongda <me@yansongda.cn>

@param string       $endpoint
@param string|array $data
@param array        $options

@return array|string
425214
public function post($endpoint, $data, $options = [])
    {
        if (!is_array($data)) {
            $options['body'] = $data;
        } else {
            $options['form_params'] = $data;
        }

        return $this->request('post', $endpoint, $options);
    }
522308
public function sendRequest(
        string $endpoint,
        array $queryString = []
    ) {
        $headers = [
            'Accept' => 'application/json',
        ];

        if ($this->getApiKey() !== null) {
            $headers['Authorization'] = base64_encode($this->getApiKey());
        }

        $curl = curl_init();

        $host = $this->isSafe === true
            ? self::BASE_SAFE_HOST
            : self::BASE_HOST;

        $requestPath = $host . $endpoint . '?' . http_build_query($queryString);

        if ($this->curlConfigurator !== null) {
            ($this->curlConfigurator)($curl);
        }

        curl_setopt($curl, CURLOPT_URL, $requestPath);
        curl_setopt($curl, CURLOPT_HTTPGET, true);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($curl, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);
        curl_setopt($curl, CURLOPT_HTTPHEADER, $this->convertArrayToCurlHeaders($headers));

        $response = curl_exec($curl);

        if (mb_strlen($curlError = curl_error($curl)) > 0) {
            throw new RuntimeException(sprintf(
                'cURL request error: %s',
                $curlError
            ));
        }

        curl_close($curl);

        return json_decode($response, true);
    }
781218
public function put($url, $data = [], array $options = [])
    {
        $options = $this->_mergeOptions($options);
        $url = $this->buildUrl($url, [], $options);

        return $this->_doRequest(Request::METHOD_PUT, $url, $data, $options);
    }
1337562
protected function get($endpoint, $params = [], $accessToken = null)
    {
        return $this->sendRequest(self::GET_METHOD, $endpoint, $params, $accessToken);
    }
549789
public function sendRequest($request, $options = [])
    {
        $client = $this->client;
        $response = $client->send($request, $options);

        return $response;
    }
1155852
private function sendRequest($endpoint, $headers = array())
    {
        $method = strtolower($this->config[$endpoint]['method']);

        if (! in_array($method, array('get', 'post', 'put', 'delete'))) {
            throw new \Exception(sprintf('%s method must be GET, POST, PUT, or DELETE', $endpoint));
        }

        if (isset($this->config['auth'])) {
            $response = $this->client->request(
                $method,
                $this->config[$endpoint]['path'],
                [
                    'auth' => [$this->config['auth']['user'], $this->config['auth']['password']],
                    'headers' => $headers,
                ]
            );
        } else {
            $response = $this->client->request(
                $method,
                $this->config[$endpoint]['path'],
                [
                    'headers' => $headers,
                ]
            );
        }

        return $response;
    }
259473
public function get(string $endPoint)
    {
        $parsedEndPoint = self::parseEndPoint($endPoint);
        return $this->sendRequest($parsedEndPoint, "GET");
    }
590887
public function post($endpoint, array $parameters = array())
    {
        return $this->execute("POST", sprintf("%s%s", $this->host, $endpoint), $parameters);
    }
179281
protected function sendRequest(
        $method,
        $endpoint,
        array $params = []
    ) {
        $request = $this->request($method, $endpoint, $params);

        return $this->lastResponse = $this->client->sendRequest($request);
    }
1187238
public function post(
        string $endpoint,
        array $options
    )
    {
        $this->streamBody = $this->client
            ->post($endpoint, $options)
            ->getBody();
    }
400324
public function send(string $method, string $endpoint, array $parameters = null)
    {
        /** @var string|array $parameters */
        $data = $this->processor->prepare($method, $parameters);

        switch ($method) {
            case 'get':
                return $this->adapter->get(
                    $this->getEndpoint() . '/' . trim($endpoint, '/') . trim($data, '/')
                );
            case 'post':
                return $this->adapter->post(
                    $this->getEndpoint() . '/' . trim($endpoint, '/'),
                    $data ?? []
                );
        }
    }
860670
public function contentEndpointRequest(string $endpoint, array $arguments, $body = ''): ResponseInterface
    {
        $headers = ['Dropbox-API-Arg' => json_encode($arguments)];

        if ($body !== '') {
            $headers['Content-Type'] = 'application/octet-stream';
        }

        try {
            $response = $this->client->post($this->getEndpointUrl('content', $endpoint), [
                'headers' => $this->getHeaders($headers),
                'body' => $body,
            ]);
        } catch (ClientException $exception) {
            throw $this->determineException($exception);
        }

        return $response;
    }
1296598
def post(self, endpoint, json=None, params=None, **kwargs):
        
        json = kwargs['data'] if 'data' in kwargs else json
        return self._make_request('post', endpoint, data=json, params=params)
468389
static public function postArray($url, $data, $options=null)
    {
        $instance = new static('POST', $url, $data, $options);
        return $instance->toArray();
    }
226611
public function post ($data)
		{
			$this->_options[ CURLOPT_POST ] = 1;
			$this->_options[ CURLOPT_POSTFIELDS ] = is_array($data) ? http_build_query($data) : $data;

			return $this->send();
		}
975053
function makeRequest(string $method, string $endpoint, array $options) {
        $request = new \CharlotteDunois\Yasmin\HTTP\APIRequest($this, $method, $endpoint, $options);
        return $this->add($request);
    }
388996
protected function set_options( Endpoint $endpoint, array $options ) {
		if ( isset( $options['guard'] ) ) {
			$endpoint->set_guard( $options['guard'] );
		}

		if ( isset( $options['filter'] ) ) {
			$endpoint->set_filter( $options['filter'] );
		}

		if ( isset( $options['prefix'] ) ) {
			$endpoint->set_prefix( $options['prefix'] );
		}

		return $endpoint;
	}