Skip to content

Instantly share code, notes, and snippets.

@tamasd
Last active December 11, 2015 21:38
Show Gist options
  • Save tamasd/4663392 to your computer and use it in GitHub Desktop.
Save tamasd/4663392 to your computer and use it in GitHub Desktop.
func updateNode(nid string, title string, body BodyField, cookie *http.Cookie) {
body.value = editBody(body.value)
postdata := fmt.Sprintf("title=%s&body[und][0][summary]=&body[und][0][value]=%s&body[und][0][format]=%s", url.QueryEscape(title), url.QueryEscape(body.Value), url.QueryEscape(body.Format))
resp := post("node/" + nid, postdata, cookie, "PUT")
if resp.StatusCode != http.StatusOK {
log.Fatal(resp.Status)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment