@@ -649,6 +649,34 @@ func (c *Client) SetRetryAfter(callback RetryAfterFunc) *Client {
649
649
return c
650
650
}
651
651
652
+ // SetJSONMarshaler method sets the JSON marshaler function to marshal the request body.
653
+ // By default, Resty uses `encoding/json` package to marshal the request body.
654
+ func (c * Client ) SetJSONMarshaler (marshaler func (v interface {}) ([]byte , error )) * Client {
655
+ c .JSONMarshal = marshaler
656
+ return c
657
+ }
658
+
659
+ // SetJSONUnmarshaler method sets the JSON unmarshaler function to unmarshal the response body.
660
+ // By default, Resty uses `encoding/json` package to unmarshal the response body.
661
+ func (c * Client ) SetJSONUnmarshaler (unmarshaler func (data []byte , v interface {}) error ) * Client {
662
+ c .JSONUnmarshal = unmarshaler
663
+ return c
664
+ }
665
+
666
+ // SetXMLMarshaler method sets the XML marshaler function to marshal the request body.
667
+ // By default, Resty uses `encoding/xml` package to marshal the request body.
668
+ func (c * Client ) SetXMLMarshaler (marshaler func (v interface {}) ([]byte , error )) * Client {
669
+ c .XMLMarshal = marshaler
670
+ return c
671
+ }
672
+
673
+ // SetXMLUnmarshaler method sets the XML unmarshaler function to unmarshal the response body.
674
+ // By default, Resty uses `encoding/xml` package to unmarshal the response body.
675
+ func (c * Client ) SetXMLUnmarshaler (unmarshaler func (data []byte , v interface {}) error ) * Client {
676
+ c .XMLUnmarshal = unmarshaler
677
+ return c
678
+ }
679
+
652
680
// AddRetryCondition method adds a retry condition function to array of functions
653
681
// that are checked to determine if the request is retried. The request will
654
682
// retry if any of the functions return true and error is nil.
0 commit comments