Php 使用wp\u remote\u post设置内容类型

Php 使用wp\u remote\u post设置内容类型,php,wordpress,Php,Wordpress,使用函数wp\u remote\u post时,如何将HTTP请求头中的content type字段设置为application/json 使用该函数发出请求时,可以在数组中的第二个参数($args)中设置头。例如: $args=array( 'headers'=>数组( '内容类型'=>'应用程序/json' ), ); $request=wp\u remote\u post($url,$args);

使用函数
wp\u remote\u post
时,如何将HTTP请求头中的
content type
字段设置为
application/json

使用该函数发出请求时,可以在数组中的第二个参数(
$args
)中设置头。例如:

$args=array(
'headers'=>数组(
'内容类型'=>'应用程序/json'
),
);
$request=wp\u remote\u post($url,$args);