如何通过函数传递字符串列表?我正在呼叫端点。目前,我将模拟API并返回字符串列表。我被困在这里。有人可以帮我吗?
mock.onGet('/patients/100/advanced-graphings').reply(200, {
advancedGraphing: '[ "Graph 1" , "Graph 2" , "Graph 3" , "Graph 4" , "Graph 5" , "Graph 6" ]'
});
答案 0 :(得分:0)
我认为您应该从advancedGraphing
对象值中删除单引号。
mock.onGet('/patients/100/advanced-graphings').reply(200, {
advancedGraphing: [ "Graph 1" , "Graph 2" , "Graph 3" , "Graph 4" , "Graph 5" , "Graph 6" ]
});