resty icon indicating copy to clipboard operation
resty copied to clipboard

How to modify response body OnAfterResponse?

Open panyox opened this issue 7 months ago • 0 comments

rc := resty.New()
rc.OnAfterResponse(func(c *resty.Client, r *resty.Response) error {
		// eg: in here, i want to modify response body
                 if r.StatusCode() == 403 {
                     // how can i change body to other content
                 }
		return nil
	})

panyox avatar Jul 08 '24 11:07 panyox