SYNOPSIS

  use WSP::Headers;
  
  # construction from field values
  my $wsp = WSP::Headers->new(
    'Date'         => 'Tue, 06 Sep 2005 06:16:43 GMT',
    'Content-Type' => 'application/vnd.wap.wmlc'
  );
  
  # construction from binary string
  my $wsp = WSP::Header->decode("\x91\x94");
  
  # encoding into a binary string
  my $binstr = $wsp->encode;

DESCRIPTION

The WSP::Headers class allows you encode and decode Wireless Session Protocol (WSP) headers to and from their binary representation. WSP::Headers is designed as a wrapper around libwww-perl's HTTP::Headers, so many of the functions found in HTTP::Headers are also available from WSP::Headers.

The following methods are available:

WSP::Headers->new
WSP::Headers->new( $field => $value, ... )

Construct a WSP::Headers and optionally initialise its value from some HTTP headers.

$h->as_string

Return a plain-text string representation of the WSP headers. This method behaves exactly like the one in HTTP::Headers.

$h->clear

Remove all header fields. This method behaves exactly like the one in HTTP::Headers.

$h->header( $field )
$h->header( $field => $value, ... )

Get or set the value of one or more header fields. This method behaves exactly like the one in HTTP::Headers.

$h->header_field_names

Return the list of distinct names for the fields present in the header. This method behaves exactly like the one in HTTP::Headers.

$h->header_remove( $field, ...)

Remove the header fields with the specified names. This method behaves exactly like the one in HTTP::Headers.

$h->encode

Encode the WSP headers into a binary string.

WSP::Headers->decode( $binstr )

Decode WSP headers from a binary string.

Copyright

umts-tools is copyright© 2004-2006 Jeremy Lainé. This software is distributed under the terms of the GNU General Public License (GPL).