VERSION
Version 0.01
=cut
our $VERSION = '0.02';
use Moo;
use LWP::UserAgent;
use JSON qw/to_json from_json/;
use Data::Dumper;
has sessionid => (
is => 'rw',
);
has csrftoken => (
is => '
eader( 'Content-Type' => 'application/json' );
# 必须加额外的这个垃圾头
$req->header( 'x-csrftoken' => $self->csrftoken );
$req->content( to_json( \%post ) );
my $res = $self->ua-
>request( $req );
if ( $res && $res->is_success ) {
my $json = from_json( $res->content );
# 输出数据
print_result( $json );
}
}
sub login {
my $self = shift;
my $uri = 'http