Understand HTTP endpoint
Last updated
Last updated
An HTTP endpoint:
Is a targetable URL in the web application, such as https://localhost:5001/HelloWorld
.
It Combines:
The protocol used: HTTPS
.
The network location of the web server, including the TCP port: localhost:5001
.
The target URI: HelloWorld
.
The first comment states this is an HTTP GET method that's invoked by appending /HelloWorld/
to the base URL.
The second comment specifies an HTTP GET method that's invoked by appending /HelloWorld/Welcome/
to the URL. Later on we will look into HTTP POST
methods, which update data.
Run the app if required or save to hot reload
Append "HelloWorld" to the path in the address bar. The Index
method returns a string.
MVC invokes controller classes, and the action methods within them, depending on the incoming URL.
The default URL routing logic used by MVC, uses a format like this to determine what code to invoke:
/[Controller]/[ActionName]/[Parameters]