接口通用POST请求方法
@param string $url 接口URL
@param array $data POST提交接口参数
@param bool $isBuildJson
@return array
@throws InvalidResponseException
@throws \WeChat\Exceptions\LocalCacheException
548801
public function callPostApi($url, array $data, $isBuildJson = true)
    {
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, $data, $isBuildJson);
    }
388874
public function httpPosRequest($url, $data)
    {
        $enc = EncryptAes::encrypt($data);
        $dataEncrypt = 'data='.$enc;
        $dataEncrypt = str_replace('+', '%2B', $dataEncrypt);
        $curl = curl_init();
        curl_setopt($curl, CURLOPT_HEADER, 0);
        curl_setopt($curl, CURLOPT_POST, count($dataEncrypt));
        curl_setopt($curl, CURLOPT_POSTFIELDS, $dataEncrypt);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curl, CURLOPT_FAILONERROR, true);
        curl_setopt($curl, CURLOPT_FRESH_CONNECT, true);
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($curl, CURLOPT_URL, $url);
        $response = curl_exec($curl);

        $resolve = $this->curlResponse->resolve($curl, $response);

        curl_close($curl);

        return $resolve;
    }
446822
protected function post(string $url, array $data = []): string
    {
        $ch = \curl_init($url);
        \curl_setopt($ch, CURLOPT_HTTPHEADER, $this->headers());
        \curl_setopt($ch, CURLOPT_POST, true);
        \curl_setopt($ch, CURLOPT_COOKIE, $this->parseCookies($this->cookies));
        \curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
        \curl_setopt($ch, CURLOPT_ENCODING, 'gzip');
        \curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

        $before_curl_time = time();
        if ($this->allowRawResponceDebug)
        {
            \is_callable($this->debugCallback) && \call_user_func($this->debugCallback, [
                'before_curl' => $before_curl_time,
            ]);
        }

        $result = \curl_exec($ch);
        $error = \curl_error($ch);
        $errno = \curl_errno($ch);
        \curl_close($ch);

        if ($this->allowRawResponceDebug)
        {
            \is_callable($this->debugCallback) && \call_user_func($this->debugCallback, [
                'raw_responce' => $result,
                'error' => $error,
                'errorno' => $errno,
                'curl_delta' => time() - $before_curl_time,
            ]);
        }

        return $result;
    }
1088532
protected function httpBuildQuery($url, array $options)
    {
        if (!empty($options)) {
            $url .= (stripos($url, '?') === null ? '&' : '?') . http_build_query($options);
        }
        return $url;
    }
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);
    }
162479
public function post($url, $data)
    {
        $request = $this->webclient->createRequest('POST', $url, array(
            'body' => $data,
        ));
        return $this->sendRequest($request);
    }
772015
public static function postRequest($url, $data)
    {
        $url = str_replace("&amp;", "&", urldecode(trim($url)));

        $options = array('http' => array('header' => "Content-type: application/x-www-form-urlencoded\r\n", 'method' => 'POST', 'content' => http_build_query($data)));
        $context = stream_context_create($options);

        try {
            $data = @file_get_contents($url, false, $context);
            return $data;
        } catch (\Exception $e) {
            return false;
        }
    }
552080
public function request($method, $url, $data = array())
    {
        $url = Api::getFullUrl($url);

        $hooks = new Requests_Hooks();

        $hooks->register('curl.before_send', array($this, 'setCurlSslOpts'));

        $options = array(
            'auth' => array(Api::getKey(), Api::getSecret()),
            'hook' => $hooks,
            'timeout' => 60,
        );

        $headers = $this->getRequestHeaders();

        $response = Requests::request($url, $headers, $data, $method, $options);

        $this->checkErrors($response);

        return json_decode($response->body, true);
    }
191103
public function post(string $url, $data, array $headers = [])
    {
        if (is_array($data)) {
            $headers['Content-type'] = self::FORM_CONTENT_TYPE;
        }

        $ctx = $this->getContext('POST', $data, $headers);
        $response = file_get_contents($url, false, $ctx);
        $this->saveCookies($http_response_header);

        return $response;
    }
45949
public function post(String $url = NULL, $data = NULL)
    {
        $response = $this->curl
                         ->init($this->url ?? $url)
                         ->option('returntransfer', true)
                         ->option('post', true)
                         ->option('ssl_verifypeer', $this->sslVerifyPeer)
                         ->option('postfields', $this->data ?? $data)
                         ->exec();

        return $this->_result($response);
    }
69131
public function request($method, $url, $data = null)
    {
        $curl = curl_init();
        curl_setopt($curl, CURLOPT_HTTPHEADER, array(
            "Content-Type: application/json",
            "Authorization: {$this->public_key},{$this->secret_key}"
        ));
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($curl, CURLOPT_URL, $this->api_url . $url);
        curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);

        if ($data !== null) {
            curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
        }

        $response = curl_exec($curl);

        if (curl_errno($curl)) {
            throw new Error('Curl error: ' . curl_error($curl));
        }
        $info = curl_getinfo($curl);
        if ($info['http_code'] != 200) {
            throw new Error('API responded with wrong status code (' . $info['http_code'] . ')', json_decode($response));
        }

        return $response;
    }
804016
public static function postRequest(string $url, array $data = [])
    {
        $url = str_replace("&amp;", "&", urldecode(trim($url)));

        if (Validate::online($url)) {
            $options = array('http' => array('header' => "Content-type: application/x-www-form-urlencoded\r\n", 'method' => 'POST', 'content' => http_build_query($data)));
            $context = stream_context_create($options);

            return file_get_contents($url, false, $context);
        }

        return false;
    }
1019635
public function post($url, array $data = [], array $headers = [])
    {
        $this->unsetOption(CURLOPT_HTTPGET);

        $this->setOptions([
            CURLOPT_CUSTOMREQUEST => 'POST',
            CURLOPT_POST => true
        ]);

        return $this->send($url, $data, $headers);
    }
582917
public function send($url, $method = 'GET', $data = [])
    {
        $method = strtolower($method);

        $settings = [
            'headers'  => array_merge([
                'Authorization' => 'Bearer ' . $this->getToken(),
                'Content-Type' => 'application/x-www-form-urlencoded',
            ], $this->getHeaders()),
        ];

        if ($method == 'post') {
            $settings['form_params'] = $data;
        }

        return $this->client
            ->$method($url, $settings);
    }
685474
protected function httpBuildQuery($url, array $options)
    {
        if (stripos($url, 'http://') === false && stripos($url, 'https://') === false) {
            $url = self::WECHAT_BASE_URL . $url;
        }
        return parent::httpBuildQuery($url, $options);
    }
1236430
public function requestJson($method, $url, $data = null)
    {
        $response = $this->request($method, $url, $data);

        $json = json_decode($response, true);
        if ($json === null) {
            throw new Error('API responded with invalid JSON');
        }

        return $json;
    }
516904
protected function _post($data) {
		$ch = curl_init();
		curl_setopt_array($ch, array(
			CURLOPT_URL            => static::ENDPOINT,
			CURLOPT_POST           => true,
			CURLOPT_POSTFIELDS     => json_encode($data),
			CURLOPT_HEADER         => false,
			CURLOPT_RETURNTRANSFER => true,
			CURLOPT_SSL_VERIFYPEER => true,
			CURLOPT_SSL_VERIFYHOST => 2,
			CURLOPT_FOLLOWLOCATION => false,
			CURLOPT_HTTPHEADER => array('Content-Type: application/json')
		));

		$response = curl_exec($ch);
		curl_close($ch);

		if ($response === false) {
			throw new Exception('Failed to contact BrowserID verification service');
		}

		$decodedResponse = json_decode($response);
		if (!$decodedResponse) {
			throw new Exception('Response is not valid JSON');
		}

		return $decodedResponse;
	}