Golang: HTTP Server

Go
Go

To test, you can run:

Shell

It should response one of the three methods (or all three).

UPDATE:

Before Golang version 1.22, you only can define “path” as the first argument of http.HandleFunc.

But, starting from Golang version 1.22 the pattern becomes:

Please check here for more information about the new pattern https://pkg.go.dev/net/http#hdr-Patterns.

References:


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *