最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

plugins - wp_remote_post To external API multiple values with the same key

programmeradmin1浏览0评论

I am trying to create a WP plugin that calls an external API using HTTP POST. I am using wp_remote_post and my arguments look like this:

$body = array(
    'CustomerID' => '10',
    'Items' => ['5', '7'],
);

What I want to end up with is this as my POST data:

CustomerID=10&Items=5&Items=7

But this does not seems to work as expected... Can anyone point me to the right direction?

Also, how can I log the final request parameters, in the same form the external API will get them?

发布评论

评论列表(0)

  1. 暂无评论