代码之家  ›  专栏  ›  技术社区  ›  Jeff Bootsholz

如何通过API调用返回json数组

  •  -1
  • Jeff Bootsholz  · 技术社区  · 6 年前

    request('https://testing.com/fund.jsp', function (error, response, body) {
    ...
    
     console.log('jsonArray : ', jsonArray);
    
    
    });
    

    如果我想让API通过本地主机:3000/getFund因此,请你告诉我下一步该做什么好吗 ?

    1 回复  |  直到 6 年前
        1
  •  1
  •   PaulShovan    6 年前

    你在用吗 ExpressJs . 如果是的话,你可以用 response.json

    response.json({ jsonArray : jsonArray });
    

    更多,你可以看看 here