2
我需要JSON數組格式的輸出數據來與jQuery DataTables一起使用,但我的API來自Apigility提供HAL + JSON。我如何轉換它,以便我可以將它從fetchAll方法的API傳遞給Datatables的AJAX URL?我如何將HAL JSON數據轉換爲JSON數據表的JSON數組
這裏是HAL + JSON的樣子:
{"_links":{"self":{"href":"http:\/\/parekh.com\/exportmanager\/courses"}},"_embedded":{"courses":[{"Module Title":"Preventing Harassment","Module ID":"HUR602","Module Language":"English"},{"Module Title":"Conflict","Module ID":"COM236","Module Language":"Dutch"},{"Module Title":"Workplace","Module ID":"HUR711","Module Language":"Dutch"}]},"total_items":3}
這有什麼用處? [https://datatables.net/forums/discussion/27383/supporting-hateoas](https://datatables.net/forums/discussion/27383/supporting-hateoas) – markpsmith
嘿,謝謝,但這並沒有解決它。該數據表不接受使用此方法的HAL + JSON格式。任何轉換建議? – Prateek
json是什麼樣的? – markpsmith