Hypothesis-API
view release on metacpan or search on metacpan
lib/Hypothesis/API.pm view on Meta::CPAN
Updates the annotation for a given annotation id if id is defined and
the user is authenticated and has update permissions. Takes a payload
as described for 'search'. Only fields specified in the new payload
are altered; other existing fields should remain unchanged.
Returns a boolean value indicating whether or not the annotation for
that id has been successfully updated (1 = yes, 0 = no).
=cut
sub update_id {
my ($self, $id, $payload) = @_;
if (not defined $id) {
die "Can only call update if given an id.";
}
my $data = $json->encode($payload);
my $h = HTTP::Headers->new;
$h->header(
'content-type' => 'application/json;charset=UTF-8',
'x-csrf-token' => $self->csrf_token,
'X-Annotator-Auth-Token' => $self->token,
( run in 0.600 second using v1.01-cache-2.11-cpan-4d4bc49f3ae )