Skip to content

Commit 4446f72

Browse files
authored
03.4.md - use DELETE HTTP method
In REST we should use DELETE HTTP method for deletion - http://www.restapitutorial.com/lessons/httpmethods.html
1 parent 4faa8d4 commit 4446f72

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

en/03.4.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ When the match is made on the `HandleFunc` function, the URL is matched, so supp
141141
http.HandleFunc("/delete/", views.DeleteTaskFunc)
142142
//DeleteTaskFunc is used to delete a task, trash = move to recycle bin, delete = permanent delete
143143
func DeleteTaskFunc(w http.ResponseWriter, r *http.Request) {
144-
if r.Method == "GET" {
144+
if r.Method == "DELETE" {
145145
id := r.URL.Path[len("/delete/"):]
146146
if id == "all" {
147147
db.DeleteAll()

0 commit comments

Comments
 (0)