Javatpoint Logo
Javatpoint Logo

Go HTTP Server

Go can be also used to create web applications. Net/http is a library package used to build web applications. It has HandelFunc() function which routes the incoming request to its corresponding function. The ListenAndServe function is used to create a resource server which listens to the provided port. The function someFunc has the http.ResponceWriter and http.Request type parameter. It is responsible to take the incoming request and after processing the return response.

Go http server example

Output:

GO Http server 1
Next TopicGo Reset Api




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


B.Tech / MCA