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

Method SetAutoDecodeContentType

client.go:815–818  ·  view source on GitHub ↗

SetAutoDecodeContentType set the content types that will be auto-detected and decode to utf-8 (e.g. "json", "xml", "html", "text").

(contentTypes ...string)

Source from the content-addressed store, hash-verified

813// SetAutoDecodeContentType set the content types that will be auto-detected and decode to utf-8
814// (e.g. "json", "xml", "html", "text").
815func (c *Client) SetAutoDecodeContentType(contentTypes ...string) *Client {
816 c.Transport.SetAutoDecodeContentType(contentTypes...)
817 return c
818}
819
820// SetAutoDecodeContentTypeFunc set the function that determines whether the specified `Content-Type` should be auto-detected and decode to utf-8.
821func (c *Client) SetAutoDecodeContentTypeFunc(fn func(contentType string) bool) *Client {

Callers 2

TestAutoDecodeFunction · 0.45
SetAutoDecodeContentTypeFunction · 0.45

Calls

no outgoing calls

Tested by 1

TestAutoDecodeFunction · 0.36