#reminder
2 catatan
|
1 view
Fri, 27 Mar 2015 10:29 am
To handle different methods differently: Many of my HTTP handlers contain nothing but a switch statement like this:
switch r.Method {
case "GET":
// Serve the resource.
case "POST":
// Create a new record.
case "PUT":
// Update an existing record.
case "DELETE":
// Remove the record.
default:
// Give an error message.
}
#go #stackoverflow #reminder