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

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

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?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745352841a4623940.html

相关推荐

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

    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

    2小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信