Curl 将卷曲转换为wp_远程_post

Curl 将卷曲转换为wp_远程_post,curl,post,php-curl,Curl,Post,Php Curl,有人能帮我把下面的curl命令转换成wp_remote_post吗 $ServerParam = 'VERSION=1.00&PWD='.$this->password.'&ID=' .$this->id.'&KEY='.$this->key.'&HASH='.$sHash; $options = array ( CURLOPT_URL

有人能帮我把下面的curl命令转换成wp_remote_post吗

        $ServerParam = 'VERSION=1.00&PWD='.$this->password.'&ID='
            .$this->id.'&KEY='.$this->key.'&HASH='.$sHash;

        $options = array
        (
            CURLOPT_URL            => $this->api_url,
            CURLOPT_POST           => true,
            CURLOPT_POSTFIELDS     => $ServerParam ,
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_SSL_VERIFYHOST => false
        );

        $curl = curl_init();
        curl_setopt_array($curl, $options);
        $response = curl_exec($curl);
        curl_close($curl);

经过几个小时的尝试,这段代码终于对我起了作用

         $body = array(
            'VERSION'       => '1.00',
            'PWD'           => $this->password,
            'ID'            => $this->id,
            'KEY'           => $this->key,
            'HASH'          => $sHash
        );

        $args = array(
            'body'        => $body,
            'timeout'     => '5',
            'redirection' => '5',
            'httpversion' => '1.0',
            'blocking'    => true,
            'headers'     => array(),
            'cookies'     => array(),
        );

        $response = wp_remote_post($this->api_url, $args);