/** * post数据 * @param $url * @param $arg * @return mixed * @throws \Exception */ private function postData($url, $arg) { $resp = Http::post($url, json_encode($arg)); $ret = json_decode($resp, true); if (isset($ret['errcode']) && $ret['errcode'] != 0) { throw new \Exception($resp); } return $ret; }
/** * POST 请求 * @param string $url * @param array $param * @param boolean $post_file 是否文件上传 * @return string content */ private function http_post($url, $param, $post_file = false) { return Http::post($url, $param, $post_file); }