The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

HTTP::Promise::Headers::ContentType - Content-Type Header Field

SYNOPSIS

    use HTTP::Promise::Headers::ContentType;
    my $ct = HTTP::Promise::Headers::ContentType->new || 
        die( HTTP::Promise::Headers::ContentType->error, "\n" );
    $ct->value( 'text/plain' );

VERSION

    v0.1.0

DESCRIPTION

The following description is taken from Mozilla documentation.

    Content-Type: text/html; charset=UTF-8
    Content-Type: application/octet-stream
    Content-Type: multipart/form-data; boundary=something
    Content-Type: application/x-www-form-urlencoded
    # Used with 206 Partial Content; rfc7233, section 5.4.1
    Content-Type: multipart/byteranges

METHODS

as_string

Returns a string representation of the Content-Type object.

boundary

Sets or gets the boundary used for multipart/form-data.

If the value is undef, it will be removed.

charset

Sets or gets the charset associated with this Content-Type

make_boundary

Returns a unique auto-generated boundary. Such auto-generated boundary is actually an uuid.

param

Set or get an arbitrary name-value pair attribute.

params

Set or get multiple name-value parameters.

Calling this without any parameters, retrieves the associated hash object

type

Sets or gets the mime-type for this field.

value

Sets or gets the mime-type for this Content-Type. This is effectively the same as "type"

AUTHOR

Jacques Deguest <jack@deguest.jp>

SEE ALSO

See also rfc7233, section 4.1, rfc7231, section 3.1.1.5 and Mozilla documentation, and this Mozilla documentation too

HTTP::Promise, HTTP::Promise::Request, HTTP::Promise::Response, HTTP::Promise::Message, HTTP::Promise::Entity, HTTP::Promise::Headers, HTTP::Promise::Body, HTTP::Promise::Body::Form, HTTP::Promise::Body::Form::Data, HTTP::Promise::Body::Form::Field, HTTP::Promise::Status, HTTP::Promise::MIME, HTTP::Promise::Parser, HTTP::Promise::IO, HTTP::Promise::Stream, HTTP::Promise::Exception

HTTP::Promise, HTTP::Promise::Headers

COPYRIGHT & LICENSE

Copyright(c) 2022 DEGUEST Pte. Ltd.

All rights reserved.

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