With the way its coded now, it will overwrite the current http.Header struct with a new one after creating the task. NewPOSTTask fills in a "Content-Type" header when there is a url.Values{} passed in.
Also, maybe this should be updated to reference modules instead of the deprecated backends?
import (
"net/url"
"appengine"
"appengine/taskqueue"
)
key := r.FormValue("key")
// Get the hostname
host, err := appengine.ModuleHostname(c, "backend1", "", "1")
if err != nil {
c.Errorf("Could not get module hostname: %v", err)
}
// Create a task pointed at a backend.
t := taskqueue.NewPOSTTask("/path/to/my/worker/", url.Values{
"key": {key},
})
t.Header["Host"] = host
// Add the task to the default queue.
err := taskqueue.Add(c, t, "")