Calling Web API from MVC controller

前端 未结 5 1366
余生分开走
余生分开走 2021-02-01 03:37

I have a WebAPI Controller within my MVC5 project solution. The WebAPI has a method which returns all files in a specific folder as a Json list:

[{\"name\":\"file

5条回答
  •  忘掉有多难
    2021-02-01 04:22

    well, you can do it a lot of ways... one of them is to create a HttpRequest. I would advise you against calling your own webapi from your own MVC (the idea is redundant...) but, here's a end to end tutorial.

提交回复
热议问题