Files
go-socket/packages/http/helper.go
T

14 lines
257 B
Go

package http
import (
"net/http"
)
func methodAllowed(response *http.ResponseWriter, request *http.Request) bool {
if request.Method != http.MethodPost {
http.Error(*response, "POST only", http.StatusMethodNotAllowed)
return false
}
return true
}