Ejemplo n.º 1
0
 /**
  * 快速发起post请求
  *
  * @param string $path
  *        请求资源路径
  * @param array $postBody
  *        请求参数
  * @param array $headers
  *        附带header
  * @param array $curlOpts
  *        附加curlOpts
  *        
  * @return array http response信息 , 具有如下结构 array(
  *         httpProtocol:'',
  *         status:'',
  *         statusMsg:'',
  *         header:array(),
  *         content:""
  *         )
  */
 function post($path = null, $postBody = null, $headers = null, $curlOpts = null)
 {
     $payload = $this->encodePostBody($postBody);
     $this->log->debug("\n\n ====== Dump the payload before Http POST send! ====== \n\n{$payload}\n\n====== End Dump! ======\n");
     return $this->request($path, self::HTTP_POST, $payload, $headers, $curlOpts);
 }