HearteatRequest.go 494 B

123456789101112131415161718192021222324
  1. package request
  2. import (
  3. "bytes"
  4. "encoding/xml"
  5. )
  6. type HeartbeatRequest struct {
  7. XMLName xml.Name `xml:"req" json:"-"`
  8. Token string `xml:"body>token" json:"token"`
  9. }
  10. func (this *HeartbeatRequest) Url() string {
  11. return "/secure/read/heartbeat"
  12. }
  13. func (this *HeartbeatRequest) GetRequestData() *bytes.Buffer {
  14. b, _ := xml.Marshal(this)
  15. return bytes.NewBuffer(b)
  16. }
  17. func NewHeartbeatRequest(t string) *HeartbeatRequest {
  18. return &HeartbeatRequest{xml.Name{}, t}
  19. }