Update Documentation?

31 views
Skip to first unread message

Prateek Malhotra

unread,
Jul 8, 2014, 1:56:02 PM7/8/14
to google-ap...@googlegroups.com
https://developers.google.com/appengine/docs/go/taskqueue/overview-push#Go_Push_queues_and_backends

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?

For Example:

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, "")

Glenn Lewis

unread,
Jul 8, 2014, 2:38:09 PM7/8/14
to Prateek Malhotra, google-appengine-go
Thanks, Prateek, for the report.  I'll work on updating it.
-- Glenn


--
You received this message because you are subscribed to the Google Groups "google-appengine-go" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengin...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages