Example #1
0
func handleDelete(w http.ResponseWriter, r *http.Request) {
	var o PostData
	ctx := appengine.NewContext(r)
	if err := datastoreutil.DeleteObject(ctx, &o); err != nil {
		http.Error(w, err.Error(), 500)
		return
	}
	jsonutil.WriteJson(w, o)
}
Example #2
0
func handle(s string) func(http.ResponseWriter, *http.Request) {
	return func(w http.ResponseWriter, r *http.Request) {
		v := struct{ Method string }{s}
		jsonutil.WriteJson(w, v)
	}
}