我使用卷曲和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);数据是来自服务器的响应。 –