---
name: "Web::Machine::Util::ContentNegotiation"
section: "3pm"
platform: "linux"
package: "libweb-machine-perl"
version: "0.17-4"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Web::Machine::Util::ContentNegotiation"
---

# Web::Machine::Util::ContentNegotiation(3pm)

Module to handle content negotiation

## NAME

Web::Machine::Util::ContentNegotiation - Module to handle content negotiation

## VERSION

version 0.17

## SYNOPSIS

```
  use Web::Machine::Util::ContentNegotiation;
```

## DESCRIPTION

This module provides a set of functions used in content negotiation.

## FUNCTIONS

- "choose\_media\_type ( $provided, $header )"

  Given an ARRAY ref of media type strings and an HTTP header, this will return the matching HTTP::Headers::ActionPack::MediaType instance.

- "match\_acceptable\_media\_type ( $to\_match, $accepted )"

  Given a media type string to match and an ARRAY ref of media type objects, this will return the first matching one.

- "choose\_language ( $provided, $header )"

  Given a list of language codes and an HTTP header value, this will attempt to negotiate the best language match.

- "choose\_charset ( $provided, $header )"

  Given a list of charset name and an HTTP header value, this will attempt to negotiate the best charset match.

- "choose\_encoding ( $provided, $header )"

  Given a list of encoding name and an HTTP header value, this will attempt to negotiate the best encoding match.

## SUPPORT

bugs may be submitted through \<https://github.com/houseabsolute/webmachine-perl/issues\>.

## AUTHORS

- •

  Stevan Little \<stevan@cpan.org\>

- •

  Dave Rolsky \<autarch@urth.org\>

## COPYRIGHT AND LICENCE

This software is copyright (c) 2016 by Infinity Interactive, Inc.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
