Re: How do I deflate content()?
Paul Webster <Paul.Webster.avzl3b-NUepA2SMhDQqspMVqqL2D+4xXEVPTSb/[email protected]> Sun, 25 Dec 2022 11:31:56 +0000
| Newsgroups | gmane.music.equipment.slimdevices.devel |
|---|---|
| Organization | Logitech Squeezebox Forums |
| Message-ID | <[email protected]> |
ser wrote: > > So I tried using unzip in that same package to deflate the payload: > > > Code: -------------------- > > $result = decode_json(Slim::Networking::SimpleHTTP::Base->unzip($response->content)); -------------------- > > > > and now it's complaining about something else: > > > Code: -------------------- > > > [22-12-25 03:11:30.1429] Slim::Networking::IO::Select::__ANON__ (130) Error: Select task failed calling Slim::Networking::Async::HTTP::_http_read_body: Can't locate object method "header" via package "Slim::Networking::SimpleHTTP::Base" at /usr/share/perl5/Slim/Networking/SimpleHTTP/Base.pm line 311. > -------------------- > > > It looks like you should call it with $response not $response->content because it is looking for the headers in the response to work out what to do https://github.com/Logitech/slimserver/blob/54e29170d26e881605e8c7df60de0644e870d36b/Slim/Networking/SimpleHTTP/Base.pm#L308 However, if it goes through Networking/SimpleHTTP/Base::processResponse then it looks like it tries to unzip automatically https://github.com/Logitech/slimserver/blob/54e29170d26e881605e8c7df60de0644e870d36b/Slim/Networking/SimpleHTTP/Base.pm#L183 Paul Webster author of \"now playing\" plugins covering radio france (fip etc), planetradio (bauer - kiss, absolute, scala, jazzfm etc), kcrw, abc australia and cbc/radio-canada and, via the extra \"radio now playing\" plugin lots more - see https://forums.slimdevices.com/showthread.php?115201-announce-radio-now-playing-plugin ------------------------------------------------------------------------ Paul Webster's Profile: http://forums.slimdevices.com/member.php?userid=105 View this thread: http://forums.slimdevices.com/showthread.php?t=117244