我使用捲曲和REST訪問數據庫和查詢搜索,我得到如下回應當我使用echo $response
:JSON響應 - PHP
HTTP/1.1 200 OK Date: Fri, 05 Aug 2016 06:53:02 GMT Server: Apache Content-Language: en-US RNT-Time: D=58292 t=1470379982660626 RNT-Machine: 128.65 Transfer-Encoding: chunked Content-Type: application/json { "items": [ { "tableName": "Country", "count": 1, "columnNames": [ "id" ], "rows": [ [ "12" ] ] } ], "links": [ { "rel": "self", "href": "https://test.cust.com/services/rest/connect/v1.3/queryResults?query=select%20ID%20from%20CO.Country%20where%20CO.Country.Country=%27USA%27" }, { "rel": "canonical", "href": "https://test.cust.com/services/rest/connect/v1.3/queryResults" }, { "rel": "describedby", "href": "https://test.cust.com/services/rest/connect/v1.3/metadata-catalog/queryResults", "mediaType": "application/schema+json" } ] }
我試圖用JSON_decode()
但如此遠我沒有任何地方,我怎麼能在這裏得到我的參數?更具體地說,「id」值。
你在客戶端還是服務器?即請求是從客戶端到服務器 - 服務器還是服務器? –
@GoldunoSupport客戶端服務器 – Zame
請求是通過ajax?如果使用\t data = JSON.parse(data);數據是來自服務器的響應。 –