Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Basic HTTP problems

by hippo (Bishop)
on Feb 05, 2021 at 14:06 UTC ( [id://11127928]=note: print w/replies, xml ) Need Help??


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]

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11127928]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-04-24 17:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found