Home > Net >  Several WebApi jump, redirect
Several WebApi jump, redirect

Time:10-12

Project now in use WebAPI + MVC but always feel very uncomfortable about jump is originally the MVC jump simply Redirect (new {controller=; Action=}) now have the following questions:
1. How to each other between the two apis jump from aAPI like I want to jump into the bapis (only request request yao)
2. From the API page jump to the MVC for example I API logic over now need to redirect page open the MVC (now my solution is to spell the full url address)
(3) from the MVC jump to webapi (now is to use the front desk to jump to the MVC)
Everyone a great god help   small grateful

CodePudding user response:

1, the API can't jump...
2, the API also cannot open the page
3, the MVC can call API, can't jump


API is not involved in the concept of page, it is only responsible for providing data, how to display and to jump between pages is UI
If you are not separated before and after the end, Suggestions or MVC mode development

CodePudding user response:

You don't use don't use API, WebAPI equivalent to automated teller machines (atms), can only save money, go to the counter to handle the business (MVC)

CodePudding user response:

reference 1/f, Eva will hit soy sauce response:
1, the API can't jump...
2, the API also cannot open the page
3, the MVC can call API, can't jump


API is not involved in the concept of page, it is only responsible for providing data, how to display and to jump between pages is UI
If you are not separated before and after the end, Suggestions or MVC mode development
thank you understand!

CodePudding user response:

refer to the second floor q363186 response:
you don't use don't use the API, WebAPI equivalent to automated teller machines (atms), only to save money, go to the counter to handle the business (MVC)

CodePudding user response:

WebAPI is the interface of MVC call he can choose XML JSON return is also A corresponding data, A API and B API not jump, A and B can communicate completely depends on the people write A and B with the MVC it doesn't matter, the MVC can call A also can be called B

CodePudding user response:

666 2nd floor this kind of person, first to report a wave, it won't don't use,

CodePudding user response:

The second floor work nine years also ask di 666

CodePudding user response:

API request Jane answer the RPC model is get, post request,
You said API request jump MVC page didn't understand what meaning, API logical end, can go to the page, such as the API request to the other people's data, show yourself to the page, where you want to consider the execution time of the API, short time synchronization request directly to display the page no problem, time is very long general processing for the asynchronous request,
The front desk to jump to the MVC, in the controller can request API,

CodePudding user response:

API is just data interface,,,, jump doesn't have anything to do with the API, jump do you want to see your front frame build,, or use the request to accept the value in the url, and behind the address together? Key=val, and the value of this way, don't need you to jump to management API,,, the API is just data interface, data model is,,, on these, the json (hope so many words can be a little ha ha

CodePudding user response:

https://www.hrefs.cn/article/netcore-swagger-webapi-doc

See webapi, I'd like to recommend swagger,,,

CodePudding user response:

A Web API so fancy stuff

CodePudding user response:

reference m0_37632094 reply: 3/f
Quote: reference 1/f, Eva will hit soy sauce response:
1, the API can't jump...
2, the API also cannot open the page
3, the MVC can call API, can't jump


API is not involved in the concept of page, it is only responsible for providing data, how to display and to jump between pages is UI
If you are not separated before and after the end, Suggestions or MVC mode development
thank you understand!



The API is to open the page, need can be configured in the Startup file

 
Public void the Configure (IApplicationBuilder app, IHostingEnvironment env)
{
//https://blog.csdn.net/fromfire2/article/details/83503883
DefaultFilesOptions DefaultFilesOptions=new DefaultFilesOptions ();
DefaultFilesOptions. DefaultFileNames. The Clear ();
DefaultFilesOptions. DefaultFileNames. Add (" index.html ");

App. UseDefaultFiles (defaultFilesOptions);

//access HTML static page
App. UseStaticFiles ();
}

CodePudding user response:

Refer to the https://bbs.csdn.net/topics/392048269