Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 3 of 3
  1. #1
    Senior Member
    Join Date
    May 2008
    Location
    Canada
    Posts
    2,904

    SimpleAsyncHTTP: getting the last redirected url

    Hi - Is there a way to get the last redirect url when receiving a response from a get for a SimpleAsyncHTTP class? I can do that using base() on LWP::UserAgent, but I know I'll be excommunicated if I use this
    LMS 7.7, 7.8 and 7.9 - 5xRadio, 3xBoom, 4xDuet, 1xTouch, 1 SB2. Sonos PLAY:3, PLAY:5, Marantz NR1603, JBL OnBeat, XBoxOne, XBMC, Foobar2000, ShairPortW, JRiver 21, 2xChromecast Audio, Chromecast v1 and v2, , Pi B3, B2, Pi B+, 2xPi A+, Odroid-C1, Odroid-C2, Cubie2, Yamaha WX-010, AppleTV 4, Airport Express

  2. #2
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    19,489

    SimpleAsyncHTTP: getting the last redirected url

    > Hi - Is there a way to get the last redirect url when receiving a
    > response from a get for a SimpleAsyncHTTP class? I can do that using
    > base() on LWP::UserAgent, but I know I'll be excommunicated if I use
    > this


    I don't think it's available from SimpleAsyncHTTP. But its underlying
    Slim::Networking::Async::HTTP class does support an onRedirect
    parameter. You could use that class directly, or inherit from
    SimpleAsyncHTTP and override its _createHTTPRequest call.

    --

    Michael

  3. #3
    Senior Member
    Join Date
    May 2008
    Location
    Canada
    Posts
    2,904
    Quote Originally Posted by mherger View Post
    > Hi - Is there a way to get the last redirect url when receiving a
    > response from a get for a SimpleAsyncHTTP class? I can do that using
    > base() on LWP::UserAgent, but I know I'll be excommunicated if I use
    > this


    I don't think it's available from SimpleAsyncHTTP. But its underlying
    Slim::Networking::Async::HTTP class does support an onRedirect
    parameter. You could use that class directly, or inherit from
    SimpleAsyncHTTP and override its _createHTTPRequest call.

    --

    Michael
    Many thanks Michael - I used Slim::Networking::Async::HTTP and set an onRedirect method to capture the redirected uri. Worked perfectly

    As usual, I could do make that without your guidance
    LMS 7.7, 7.8 and 7.9 - 5xRadio, 3xBoom, 4xDuet, 1xTouch, 1 SB2. Sonos PLAY:3, PLAY:5, Marantz NR1603, JBL OnBeat, XBoxOne, XBMC, Foobar2000, ShairPortW, JRiver 21, 2xChromecast Audio, Chromecast v1 and v2, , Pi B3, B2, Pi B+, 2xPi A+, Odroid-C1, Odroid-C2, Cubie2, Yamaha WX-010, AppleTV 4, Airport Express

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •