in reply to [SOLVED] Basic HTTP problems

sid = req.text[-32:]

I don't speak python so don't know what this is doing but as there's no reference to "32" anywhere in your Perl code perhaps it is something which needs to be addressed.

See the Basic Debugging Checklist for more info. Print data sent before every request (particularly that auth - seems an obvious place for something to go wrong) and $res->code for every response until you nail it down.


🦛

Replies are listed 'Best First'.
Re^2: Basic HTTP problems
by Fletch (Bishop) on Feb 05, 2021 at 14:16 UTC

    I believe that's a python-y array slice pulling off the last 32 characters of the (in this case) string so OP'd need something like $sid = substr( $req->content, -32 ) to get the equivalent value (although blindly pulling out the last 32 characters rather than actually parsing the returned value may be living dangerously regardless of the implementation language . . .).

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

Re^2: Basic HTTP problems
by choroba (Cardinal) on Feb 05, 2021 at 14:16 UTC
    It corresponds to
    my $sid = substr $res->content, -32;
    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]