Skip Menu |
 

This queue is for tickets about the MediaWiki-API CPAN distribution.

Report information
The Basics
Id: 114392
Status: rejected
Priority: 0/
Queue: MediaWiki-API

People
Owner: Nobody in particular
Requestors: HPAVC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.41
Fixed in: (no value)



Subject: api upload issue
Download (untitled) / with headers
text/plain 678b
The method API upload seems broken, it always requires a token similar to this, I cal call this method between two $wm->edit() calls and the edits will work fine, if I remove the token and the die() the function will ... "3: notoken: The token parameter must be set at" $mw->api( { action => 'upload', token => $mw->{'config'}->{'tokens'}->{'edit'}, ignorewarnings => 1, filename => $imgtitle, comment => '[[Category:Portraits]][[Category:Clipart]]', file => [ undef, $imgtitle, Content => $imgdata ], } ) || die $mw->{error}->{code} . ': ' . $mw->{error}->{details};
Download (untitled) / with headers
text/plain 796b
use the "edit" call and the token will be set automatically. Using the api call you have to handle any token work. On Sun May 15 10:14:02 2016, HPAVC wrote: Show quoted text
> The method API upload seems broken, it always requires a token similar > to this, I cal call this method between two $wm->edit() calls and the > edits will work fine, if I remove the token and the die() the function > will ... "3: notoken: The token parameter must be set at" > > $mw->api( { > action => 'upload', > token => $mw->{'config'}->{'tokens'}->{'edit'}, > ignorewarnings => 1, > filename => $imgtitle, > comment => '[[Category:Portraits]][[Category:Clipart]]', > file => [ undef, $imgtitle, Content => $imgdata ], > } ) > || die $mw->{error}->{code} . ': ' . $mw->{error}->{details};


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.