The manakai project


A data: URL struct


  use Web::Transport::DataURL;
  $mime = $parser->parse_string ('text/plain; charset=utf-8');
  $body = "body byte sequence";
  $data = Web::Transport::DataURL->new_from_mime_and_scalarref ($mime, \$body);
  is $data->mime_type, $mime;
  is ${$data->body_ref}, $body;


The Web::Transport::DataURL class represents data: URL struct.


$data = Web::Transport::DataURL->new_from_mime_and_scalarref ($mime, $ref)

Create a new data: URL struct and return it.

The first argument must be a MIME type (a Web::MIME::Type object). The data: URL struct's MIME type is set to the argument.

The second argument must be the reference to a scalar value that is a byte string. The data: URL struct's body is set to the scalar value. After the invocation of the method, the application should not modify the scalar.

$mime = $data->mime_type

Return the MIME type object of the data: URL struct.

$ref = $data->body_ref

Return the reference to the body of the data: URL struct.


Fetch Standard <>.


Wakaba <>.


Copyright 2018 Wakaba <>.

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