Wordpress - xmlhttprequest:将 XML 发送到 WebService 以获取令牌

问题描述 投票:0回答:0

我正在尝试这行代码将 XML 发送到 WebService 以获得授权令牌:

$xml = 'https://my_xml_file.xml';       
$response = wp_remote_request( 'http://webservice_url.asmx',$xml);
$body = wp_remote_retrieve_body($response);
print_r($body) ; 

问题是我没有得到回应。 我认为问题是 xml 没有以正确的方式发送。 我应该在函数“wp_remote_request”中使用“数组”来设置文件类型、发送方法等吗?

web-services xmlhttprequest wordpress-rest-api
© www.soinside.com 2019 - 2024. All rights reserved.