InstallCodec adds codec to this API's available codecs. Codecs installed first take precedence over codecs installed later when evaluating wildcards in Accept headers. The first installed codec is used as a fallback when the Accept header cannot be satisfied or if there is no Accept header.
(codec Codec)
| 382 | // Codecs installed first take precedence over codecs installed later when evaluating wildcards in Accept headers. |
| 383 | // The first installed codec is used as a fallback when the Accept header cannot be satisfied or if there is no Accept header. |
| 384 | func (api *API) InstallCodec(codec Codec) { |
| 385 | api.codecs = append(api.codecs, codec) |
| 386 | } |
| 387 | |
| 388 | // ClearCodecs removes all available codecs from this API, including the default codec installed by NewAPI. |
| 389 | func (api *API) ClearCodecs() { |
no outgoing calls