TL;DR; use struct tags to specify marshal/unmarsal names. type LoginRequest struct {
User string `json:"username"` Passw string `json:"password"` } ... SetBody(struct { Type string `json:"type"` LoginRequest }{ Type: "LoginRequest", LoginRequest:{User:"my_admin", Passw:"testing123"}}) -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.