0
預先感謝您 我試着用捲曲使用獲得的OData服務的URL下面的代碼OData服務不能完全返回JSON在PHP捲曲
<?php
$url = "serviceurl/odata.srv/Users?$format=json&$expand=EmployeeDetails/ClientDetails/ClientConfigurationDetails,EmployeeDetails/ClientDetails/LogoDetails,SalutationTexts,UserConfigurationDetails";
$ch = curl_init($url); // such as http://example.com/example.xml
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, "username:password");
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Accept: application/json'));
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_HEADER, 0);
$data = curl_exec($ch);
curl_close($ch);
echo $data;
僅造成用戶詳細介紹了擴大細節並不存在,但在郵遞員並直接在瀏覽器中調用它的做工精細獲得所有細節
這是我的錯誤,我忘了在URL中的特殊字符 –