AnyEvent-Mattermost

 view release on metacpan or  search on metacpan

lib/AnyEvent/Mattermost.pm  view on Meta::CPAN

}

sub _headers {
    my ($self) = @_;

    my $headers = [
        'Content-Type'      => 'application/json',
        'X-Requested-With'  => 'XMLHttpRequest',
    ];

    # initial_load is fine with just the Cookie, other endpoints like channels/
    # require Authorization. We'll just always include both to be sure.
    if (exists $self->{'token'}) {
        push(@{$headers},
            'Cookie'        => 'MMAUTHTOKEN=' . $self->{'token'},
            'Authorization' => 'Bearer ' . $self->{'token'},
        );
    }

    return $headers;
}



( run in 0.261 second using v1.01-cache-2.11-cpan-b61123c0432 )