MCPcopy Index your code
hub / github.com/imroc/req / SetResultStateCheckFunc

Method SetResultStateCheckFunc

client.go:214–217  ·  view source on GitHub ↗

SetResultStateCheckFunc overrides the default result state checker with customized one, which returns SuccessState when HTTP status `code >= 200 and <= 299`, and returns ErrorState when HTTP status `code >= 400`, otherwise returns UnknownState.

(fn func(resp *Response) ResultState)

Source from the content-addressed store, hash-verified

212// which returns SuccessState when HTTP status `code >= 200 and <= 299`, and returns
213// ErrorState when HTTP status `code >= 400`, otherwise returns UnknownState.
214func (c *Client) SetResultStateCheckFunc(fn func(resp *Response) ResultState) *Client {
215 c.resultStateCheckFunc = fn
216 return c
217}
218
219// SetCommonFormDataFromValues set the form data from url.Values for requests
220// fired from the client which request method allows payload.

Callers 2

SetResultStateCheckFuncFunction · 0.80

Calls

no outgoing calls

Tested by 1