post请求
@param string $url 接口相对路径
@param array $data 接口传参
@param array $headers HTTP Header
@return mixed
@throws GuzzleException
969655
public function post($url, $data, $headers = [])
    {
        $request = new Request('POST', $url, $headers);
        $response = $this->apiClient->send(
            $request,
            [
                'form_params' => $data,
            ]
        );
        $result = json_decode($response->getBody(), true);
        return $result;
    }
1211178
private function doRequest($method, $url, array $headers = [], array $data = [])
    {
        $request = new Request($method, $url, $headers, \GuzzleHttp\json_encode($data));
        $response = $this->httpClient->sendRequest($request);

        return new Response(
            $response->getStatusCode(),
            $response->getBody()->getContents(),
            /** @scrutinizer ignore-type */
            $response->getHeaders()
        );
    }
237691
public function put($url, $data = null, $headers = [], $options = [])
    {
        return $this->createRequestShortcut('PUT', $url, $data, $headers, $options);
    }
122146
protected function apiPost($url, $data)
    {
        if (empty($data['client_ip'])) {
            $data['client_ip'] = sprintf("%d.%d.%d.%d", rand(1, 244), rand(1, 244), rand(1, 244), rand(1, 244));
        }

        $response = $this->apiClient->post($url, array(
            'body' => $data,
        ));

        return $this->processResponse($response);
    }
1328070
public function post($url, $data = null, $headers = [], $options = [])
    {
        return $this->createRequestShortcut('POST', $url, $data, $headers, $options);
    }
479517
private function send_http($url, $data, $headers=[])
    {
        if ($this->curl_method == 'async') {
            $this->_curl_handler->enqueue($url, $data, $headers);
        } elseif ($this->curl_method == 'exec') {
            $this->send_http_asynchronous_curl_exec($url, $data, $headers);
        } else {
            $this->send_http_synchronous($url, $data, $headers);
        }
    }
100334
public function call($url, $data, $type = self::TYPE_POST)
    {
        $data['access_token'] = $this->token;

        if (!is_null($this->appsecret_proof)){
            $data['appsecret_proof'] = $this->appsecret_proof;
        }
        
        $headers = [
            'Content-Type: application/json',
        ];

        if ($type == self::TYPE_GET) {
            $url .= '?'.http_build_query($data);
        }

        $process = curl_init($this->apiUrl.$url);
        curl_setopt($process, CURLOPT_HTTPHEADER, $headers);
        curl_setopt($process, CURLOPT_HEADER, false);
        curl_setopt($process, CURLOPT_TIMEOUT, 30);

        if($type == self::TYPE_POST || $type == self::TYPE_DELETE) {
            curl_setopt($process, CURLOPT_POST, 1);
            curl_setopt($process, CURLOPT_POSTFIELDS, json_encode($data));
        }

        if ($type == self::TYPE_DELETE) {
            curl_setopt($process, CURLOPT_CUSTOMREQUEST, "DELETE");
        }

        curl_setopt($process, CURLOPT_RETURNTRANSFER, true);
        $return = curl_exec($process);

        /**
         * Check for cURL Errors and, if found display the error code
         *
         * @see http://php.net/manual/en/function.curl-error.php
         */
        $curl_error = curl_error($process);
        if ($curl_error) {
            $this->curl_error = $curl_error;
        }

        curl_close($process);

        return json_decode($return, true);
    }
1156953
public static function post($url, array $data)
    {
        $ch = curl_init();

        curl_setopt($ch, CURLOPT_URL,            TotalVoice::$api . $url);
        curl_setopt($ch, CURLOPT_POST,           1);
        curl_setopt($ch, CURLOPT_POSTFIELDS,     http_build_query($data));
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_HTTPHEADER,     ['Access-Token: ' . TotalVoice::$token]);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

        $output = curl_exec($ch);
        $info = curl_getinfo($ch);
        curl_close($ch);

        $response = new HttpResponse();
        $response->setStatusCode((int)$info['http_code']);
        $response->setContentType($info['content_type']);
        $response->setContent(json_decode($output));
        return $response;
    }
404365
public function curljson($url, $method = 'GET', $data = array(), $headers = array())
    {

        /**
         * curl_init url_setopt($ch,CURLOPT_ENCODING, '');
         *
         * http://stackoverflow.com/a/3277224
         * Just tell cURL to decode the response automatically whenever it's gzipped         *
         * curl_setopt($ch,CURLOPT_ENCODING, ''); // dekodowanie automatyczne
         *
         *
         *
         */


        $url = $this->endpoint.$url;

        $method = strtoupper($method);

        $ch = curl_init();
        
        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT , 10); 

        curl_setopt($ch, CURLOPT_USERPWD, $this->user.':'.$this->password);

        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);

        curl_setopt($ch, CURLOPT_URL, $url);

        if (count($data)) {
            curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
        }

        $headers = array_merge($headers, array(
            'Content-Type: application/json',
        ));

        if (count($headers)) {
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
        }

        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

        $result = null;
        $result = curl_exec($ch);

        curl_close($ch);

        $json = json_decode($result, true);

        if (count($json)) {
            return $json;
        }

        throw new Exception($result);
    }
28957
public function goPost($url = '', $data = [], $timeout = 30000, $headers = [])
    {
        if (empty($data)) {
            throw new Exception('post data is empty');
        }

        if (!($this->client instanceof \swoole_http_client)) {
            throw new Exception('You must complete the DNS query first, Such as $client->goDnsLookup()');
        }

        if (empty($this->urlData)) {
            $this->urlData = self::parseUrl($url);
        } else {
            if (!empty($url)) {
                $this->urlData['path'] = $url;
            }
        }
        $this->setHeaders($headers);
        $sendPostReq  = $this->getObject(Http::class, [$this, 'POST', $this->urlData['path'], $data, $timeout]);

        return $sendPostReq;
    }
749337
protected function sendRequest($method, $url, $data = array(), $headers = array()) {
        $contextOptions = array(
            'http' => array(
                'method' => $method,
                'user_agent' => 'MinecraftJP-PHP-SDK/' . self::VERSION,
                'ignore_errors' => true,
            ),
        );

        if ($method == 'POST' && is_array($data)) {
            $formEncoded = http_build_query($data);
            $headers['Content-Type'] = 'application/x-www-form-urlencoded';
            $headers['Content-Length'] = strlen($formEncoded);
            $contextOptions['http']['content'] = $formEncoded;
        }

        $contextOptions['http']['header'] = '';
        foreach ($headers as $k => $v) {
            $contextOptions['http']['header'] .= $k . ': ' . $v . "\r\n";
        }
        $context = stream_context_create($contextOptions);

        $body = file_get_contents($url, false, $context);
        return new HttpResponse($http_response_header, $body);
    }
907500
public function post($url, $headers = [], $body = null)
    {
        output(func_get_args(),'ppp');
        return $this->send(Method::POST, $url, $body, $headers);
    }
707375
public function doPostRequest(
      string $url,
      array $data,
      array $headers = [],
      bool $closeConnection = true
    ) {
        $this->setUrl($url)
            ->setPostMethod()
            ->setPostFields($data)
            ->setMustReturnTransfer()
            ->setHttpHeader($headers)
            ->execute(true, $closeConnection);
        $this->_call($this->callback ?? function (FluentCurl $instance) {
        }, $this);

        return $this;
    }
979766
public static function sendPost($_url, $_data, $_headers = [],
                                    $_return_header = true)
    {
        return self::sendCurl($_url,
                array(
                CURLOPT_SSL_VERIFYHOST => false,
                CURLOPT_SSL_VERIFYPEER => false,
                CURLOPT_FOLLOWLOCATION => 0,
                CURLOPT_POST => 1,
                CURLOPT_POSTFIELDS => $_data,
                CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
                CURLOPT_HTTPHEADER => $_headers,
                CURLOPT_HEADER => $_return_header
        ));
    }
598429
public static function post($url, array $data = [], array $headers = [])
    {
        // $headers = [ 'Content-Type: application/json' ];

        $ch = curl_init();

        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $data); // 发送数据
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

        // 执行HTTP请求
        return self::execute($ch);
    }
750012
private function send_remote($url, $data, $headers=[])
    {
        $parts = parse_url($url);
        $parts['netloc'] = $parts['host'].(isset($parts['port']) ? ':'.$parts['port'] : null);
        $this->send_http($url, $data, $headers);
    }
925357
public function put($url, $data = '', array $headers = [])
    {
        return $this->executor->execute(
            $url,
            [
                CURLOPT_CUSTOMREQUEST  => 'PUT',
                CURLOPT_HTTPHEADER => $headers,
                CURLOPT_POSTFIELDS => $data,
            ]
        );
    }