Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RedirectPolicy ¶
RedirectPolicy to regulate the redirects in the resty client. Objects implementing the RedirectPolicy interface can be registered as
Apply function should return nil to continue the redirect jounery, otherwise return error to stop the redirect.
func DomainCheckRedirectPolicy ¶
func DomainCheckRedirectPolicy(hostnames ...string) RedirectPolicy
DomainCheckRedirectPolicy is convenient method to define domain name redirect rule in resty client. Redirect is allowed for only mentioned host in the policy.
resty.SetRedirectPolicy(DomainCheckRedirectPolicy("host1.com", "host2.org", "host3.net"))
func FlexibleRedirectPolicy ¶
func FlexibleRedirectPolicy(noOfRedirect int) RedirectPolicy
FlexibleRedirectPolicy is convenient method to create No of redirect policy for HTTP client.
resty.SetRedirectPolicy(FlexibleRedirectPolicy(20))
func NoRedirectPolicy ¶
func NoRedirectPolicy() RedirectPolicy
NoRedirectPolicy is used to disable redirects in the HTTP client
resty.SetRedirectPolicy(NoRedirectPolicy())
type RedirectPolicyFunc ¶
The RedirectPolicyFunc type is an adapter to allow the use of ordinary functions as RedirectPolicy. If f is a function with the appropriate signature, RedirectPolicyFunc(f) is a RedirectPolicy object that calls f.