Questions tagged «wp-remote-post»

1
通过wp_remote_post()发送JSON字符串
我正在建立mailchimp集成,它们需要使用JSON代码进行POST调用。 不,我使用的是实际有效的代码: $data = wp_remote_post($url, array( 'headers' => array('Content-Type' => 'application/json; charset=utf-8'), 'body' => json_encode($array_with_parameters), 'method' => 'POST' )); 但是,它返回一个PHP警告 警告:http_build_query():参数1应该是数组或对象。第507行的../wp-includes/Requests/Transport/cURL.php中给出的值不正确 怎么回事? 我试图只在'body'索引中使用普通数组,但是MailChimp返回JSON解析错误。
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.