package request import ( "bytes" "encoding/xml" ) type HeartbeatRequest struct { XMLName xml.Name `xml:"req" json:"-"` Token string `xml:"body>token" json:"token"` } func (this *HeartbeatRequest) Url() string { return "/secure/read/heartbeat" } func (this *HeartbeatRequest) GetRequestData() *bytes.Buffer { b, _ := xml.Marshal(this) return bytes.NewBuffer(b) } func NewHeartbeatRequest(t string) *HeartbeatRequest { return &HeartbeatRequest{xml.Name{}, t} }