我正在研究 drupal 7。我在 drupal 视图中创建了一个休息服务。我想在我的 android 应用程序中使用此服务。当我尝试查看我的服务时
http://mysite.com/ubercart/?q=rest/views/doctor
我得到这样的回应
[{,"foaf:Document"],"title":{"predicates":["dc:title"]},"created":{"predicates":["dc:date","dc:created"] ,"datatype":"xsd:dateTime","callback":"date_iso8601"},"changed":{"predicates":["dc:modified"],"datatype":"xsd:dateTime","callback" :"date_iso8601"},"body":{"predicates":[""vid":"12","uid":"1","title":"raja","log":"","status ":"1","comment":"2","promote":"0","sticky":"0","nid":"12","type":"doctor","language": “和”,created":"1351849158","changed":"1351849158","tnid":"0","translate":"0","revision_timestamp":"1351849158","revision_uid":"1","field_rating" :{"und":[{"value":"4"}]},"field_place":{"und":[{"value":"Guntur","format":null,"safe_value":"Guntur "}]},"rdf_mapping":{"rdftype":["sioc:Item","foaf:Document"],"title":{"predicates":["dc:title"]},"created": {"predicates":["dc:date","dc:created"],"datatype":"xsd:dateTime","callback":"date_iso8601"},"changed":{"predicates":["dc:modified"],"datatype":"xsd:dateTime","callback":"date_iso8601"},"body":{"predicates":["content:encoded"]},"uid":{ "predicates":["sioc:has_creator"],"type":"rel"},"name":{"predicates":["foaf:name"]},"comment_count":{"predicates":[" sioc:num_replies"],"datatype":"xsd:integer"},"last_activity":{"predicates":["sioc:last_activity_date"],"datatype":"xsd:dateTime","callback":"date_iso8601 "}},"cid":"0","last_comment_timestamp":"1351849158","last_comment_name":null,"last_comment_uid":"1","comment_count":"0","name":"admin","picture":"0","data":"b:0;","uc_order_product_id":false,"ucnc_product_nid":false},{"vid ":"11","uid":"1","title":"ravi","log":"","status":"1","comment":"2","promote":" 0","sticky":"0","nid":"11","type":"doctor","language":"und","created":"1351849131","changed":"1351849131" ,"tnid":"0","translate":"0","revision_timestamp":"1351849131","revision_uid":"1","field_rating":{"und":[{"value":"5"}]},"field_place":{"und":[{"value":"Hyderabad","format":null,"safe_value":"Hyderabad"}] },"rdf_mapping":{"rdftype":["sioc:Item","foaf:Document"],"title":{"predicates":["dc:title"]},"created":{"predicates ":["dc:date","dc:created"],"datatype":"xsd:dateTime","callback":"date_iso8601"},"changed":{"predicates":["dc:modified" ],"datatype":"xsd:dateTime","callback":"date_iso8601"},"body":{"predicates":["content:encoded"]},"uid":{"predicates":[" sioc:has_creator"],"type":"rel"},"name":{"predicates":["foaf:name"]},"comment_count":{"predicates":["sioc:num_replies"],"datatype":"xsd: integer"},"last_activity":{"predicates":["sioc:last_activity_date"],"datatype":"xsd:dateTime","callback":"date_iso8601"}},"cid":"0"," last_comment_timestamp":"1351849131","last_comment_name":null,"last_comment_uid":"1","comment_count":"0","name":"admin","picture":"0","data":" b:0;","uc_order_product_id":false,"ucnc_product_nid":false},{"vid":"10","uid":"1","标题":"sree","log":"","status":"1","comment":"2","promote":"0","sticky":"0","nid": "10","type":"doctor","language":"und","created":"1351849109","changed":"1351849109","tnid":"0","translate":"0 ","revision_timestamp":"1351849109","revision_uid":"1","field_rating":{"und":[{"value":"4"}]},"field_place":{"und":[ {"value":"Hyderabad","format":null,"safe_value":"Hyderabad"}]},"rdf_mapping":{"rdftype":["sioc:Item"content:编码"]},"uid":{"predicates":["sioc:has_creator"],"type":"rel"},"name":{"predicates":["foaf:name"]}," comment_count":{"predicates":["sioc:num_replies"],"datatype":"xsd:integer"},"last_activity":{"predicates":["sioc:last_activity_date"],"datatype":"xsd :dateTime","callback":"date_iso8601"}},"cid":"0","last_comment_timestamp":"1351849109","last_comment_name":null,"last_comment_uid":"1","comment_count":"0 ","名称":"管理员","图片":"0","数据":"b:0;","uc_order_product_id":false,"ucnc_product_nid":false}]
其实我需要这样的回应
{"nodes":{"0":{"node":{"title":"raja","field_place":"Guntur","rating":"4"}},"1":{"node" :{"title":"ravi","field_place":"Hyderabad","rating":"5"}},"2":{"node":{"title":"sree","field_place": "海得拉巴","评级":"4"}}}}
谁能帮我吗?