Runs a POST request.

@param string      $uri     The URI to post to.
@param string|null $body    The body to post.
@param array       $options The options.

@return \Psr\Http\Message\ResponseInterface
2888
protected function postRequest($uri, $body = null, $options = array())
    {
        if ($this->testMode) {
            $options['debug'] = true;
        }

        $headers = array(
            'Content-Type'               => 'application/json',
            'Accept'                     => 'application/json',
            'X-Verkkomaksut-Api-Version' => $this->apiVersion,
        );

        $options = array_merge(
            array(
                'auth'            => array($this->_apiKey, $this->_apiSecret),
                'timeout'         => 30,
                'connect_timeout' => 10,
            ),
            $options
        );

        $request = new Request('POST', $uri, $headers, $body);

        return $this->_client->send($request, $options);
    }
311157
public function post($uri, array $headers = [], $body = null)
    {
        return $this->send('POST', $uri, $headers, $body);
    }
328997
public function patch($uri, $body = null, array $options = [])
    {
        return $this->request(self::REQUEST_METHOD_PATCH, $uri, $body, $options);
    }
785407
protected function _request( $uri, array $params = array() )
    {
        $this->_client->setUri($uri);
        $this->_client->setParameterGet($params);

        try {
            $response = $this->_client->request();
        } catch (Exception $e) {
            return null;
        }

        if ( $response->getStatus() != 200 ) {
            return false;
        }

        return $response->getBody();
    }
776075
public function post($url, $params = array(), $options = array(), $body = '')
    {
        $client = new \GuzzleHttp\Client($options);
        $query = $this->getQueryParam4AccessToken();
        $response = $client->post($url, array(
            'query' => $query,
            'body' => empty($body) ? json_encode($params, JSON_UNESCAPED_UNICODE) : $body
        ));
        if ($this->isSuccessful($response)) {
            return $this->getJson($response); // $response->json();
        } else {
            throw new Exception("微信服务器未有效的响应请求");
        }
    }
822795
public function post($body)
    {
        $curl = $this->createCurl();

        curl_setopt($curl, CURLOPT_POST, true);
        curl_setopt($curl, CURLOPT_POSTFIELDS, $body);

        return $this->execute($curl);
    }
824167
protected function sendRequest(string $method, string $uri, array $options = []): array
    {
        $request = $this->client->createRequest($method, $uri);

        $key = $method === Api::GET ? 'query' : 'form_params';
        $options[$key] = $this->signRequest(
            $method,
            $request->getUri()->__toString(),
            $options[$key] ?? []
        );

        return $this->processResponse(
            $this->client->send($request, $options)
        );
    }
649995
protected function httpPostJson($uri, $body)
    {
        $this->log[] = [
                        'request' => [
                                    'method' => 'POST',
                                    'uri'    => $uri,
                                    'body'   => $body,
                                    ],
                        ];
        $response = \Httpful\Request::post($uri)
                                                ->addHeader('X-Auth-Email', $this->email)
                                                ->addHeader('X-Auth-Key', $this->apikey)
                                                ->sendsAndExpects(\Httpful\Mime::JSON)
                                                ->parseWith(function ($body) {
                                                    return \Metaclassing\Utility::decodeJson($body);
                                                })
                                                ->body($body)
                                                ->send()
                                                ->body;
        $this->log[count($this->log) - 1]['response'] = $response;
        if ($response['success'] != true) {
            throw new \Exception("post to {$uri} unsuccessful");
        }

        return $response['result'];
    }
836038
public function send( string$body=null ):Response
	{
		$this->justSend($body);

		return new Response( $this, $this->handle );
	}
1065871
public function sendRequestAsync($type, $uri, $options = null)
    {
        $request = null;
        switch ($type) {
            case 'GET':
                $request = $this->oauthRequestClient
                    ->getAsync($uri, $options);
                break;
            case 'POST':
                $request = $this->oauthRequestClient
                    ->postAsync($uri, $options);
                break;
            case 'DELETE':
                $request = $this->oauthRequestClient
                    ->deleteAsync($uri, $options);
                break;
            default :
                throw new Exception("The request type you entered is not valid.");
                break;
        }
        return $request->then(
            function (ResponseInterface $response) {
                $contentType = self::checkResponseContentType($response->getHeader('Content-Type'));
                switch ($contentType) {
                    case 'json':
                        return json_decode($response->getBody(), true);
                        break;
                    case 'string':
                        return (string)$response->getBody();
                        break;
                    case 'html':
                        return $response;
                        break;
                    default:
                        // If we don't know the response type but it was a successful request, it's probably okay.
                        if($response->getStatusCode() >= 200 && $response->getStatusCode() < 300) {
                            return $response;
                        }
                        throw new Exception("The response type not recognized.");
                }
            }
        );
    }
976103
public function create($body, $options = array()) {
        $options = new Values($options);

        $data = Values::of(array(
            'Body' => $body,
            'From' => $options['from'],
            'Attributes' => $options['attributes'],
        ));

        $payload = $this->version->create(
            'POST',
            $this->uri,
            array(),
            $data
        );

        return new MessageInstance(
            $this->version,
            $payload,
            $this->solution['serviceSid'],
            $this->solution['channelSid']
        );
    }
404944
public function request($url, $method = 'GET', $options = []): ResponseInterface
    {
        $method = strtoupper($method);

        $options = array_merge(self::$defaults, $options, ['handler' => $this->getHandlerStack()]);

        $options = $this->fixJsonIssue($options);

        if (property_exists($this, 'baseUri') && !is_null($this->baseUri)) {
            $options['base_uri'] = $this->baseUri;
        }

        $response = $this->getHttpClient()->request($method, $url, $options);
        $response->getBody()->rewind();

        return $response;
    }
302402
private function sendRequest($path, $requestBody, $options, $method)
    {
        $url = $this->instanceURLRepo->get();
        $url .= '/'.trim($path, "/\t\n\r\0\x0B");

        $options['method'] = $method;
        if (!empty($requestBody)) {
            $options['body'] = $requestBody;
        }

        return $this->request($url, $options);
    }
377561
public function perform($action, $table, $body, $options = [])
    {
        $query = $this->createQuery($action, $table, $options)->body($body);

        return $this->createRequest($query);
    }
1254842
public function custom(string $method, string $uri, string $body='', array $headers=[])
  {
    $this->sendRequest($this->createRequest($method,$uri), $headers);

    return !is_null($this->getResponse());
  }
876219
public function get($url, $options = [], $body = null, $raw = true)
    {
        return $this->httpRequest('GET', $this->createUrl($url, $options), $body, $raw);
    }
1050067
public function createRequest($method, $uri, array $headers = [], $body = null, $protocol = '1.1')
    {
        if (is_array($body)) {
            $body = http_build_query($body, '', '&');
        }

        if ($method == 'GET') {
            $uri .= ((strpos('?', $uri) === false) ? '?' : '&').$body;
            $body = '';
        }

        return $this->requestFactory->createRequest($method, $uri, $headers, $body, $protocol);
    }