HTTP::Headers::ActionPack::MediaType(3pm)

HTTP::Headers::ActionPack::MediaType3pm

A media type

Usage

  use HTTP::Headers::ActionPack::MediaType;
  # normal constructor
  my $mt = HTTP::Headers::ActionPack::MediaType->new(
      'application/xml' => (
          'q'       => 0.5,
          'charset' => 'UTF-8'
      )
  );
  # construct from string
  my $mt = HTTP::Headers::ActionPack::MediaType->new_from_string(
      'application/xml; q=0.5; charset=UTF-8'
  );

Version

version 0.09

Overview

This is an object which represents an HTTP media type definition. This is most often found as a member of a HTTP::Headers::ActionPack::MediaTypeList object.

Methods

"type"

Accessor for the type.

"major"

The major portion of the media type name.

"minor"

The minor portion of the media type name.

"matches_all"

A media type matched all if the type is "*/*" and if it has no parameters.

"equals ( $media_type | $media_type_string )"

This will attempt to determine if the $media_type is exactly the same as itself. If given a $media_type_string it will parse it into an object.

In order for two type to be equal, the types must match exactly and the parameters much match exactly.

"exact_match ( $media_type | $media_type_string )"

This will attempt to determine if the $media_type is a match with itself using the "type_matches" method below. If given a $media_type_string it will parse it into an object.

In order for an exact match to occur it the types must be compatible and the parameters much match exactly.

"match ( $media_type | $media_type_string )"

This will attempt to determine if the $media_type is a match with itself using the "type_matches" method and "params_match" method below. If given a $media_type_string it will parse it into an object.

In order for an exact match to occur it the types must be compatible and the parameters must be a subset.

"type_matches ( $media_type | $media_type_string )"

This will determine type compatibility, properly handling the "*" types and major and minor elements of the type.

"params_match ( $parameters )"

This determines if the $parameters are a subset of the invocants parameters.

Contributors

•

Andrew Nelson <[email protected]>

•

Dave Rolsky <[email protected]>

•

Florian Ragwitz <[email protected]>

•

Jesse Luehrs <[email protected]>

•

Karen Etheridge <[email protected]>

Releases

5 releases since Debian 9 (Stretch); the text changed 3 times.

  1. 9–10
  2. 11
  3. 12
  4. 13

Author

Stevan Little <[email protected]>

From libhttp-headers-actionpack-perl 0.09-3 in Debian 13 (Trixie). Parsed by carta from the page's man source.