Re: Retrieve final URL after redirection



On 09/07/2013 10:19 AM, Daniel Drake wrote:
I tried that, and it doesn't seem to work.

session = Soup.SessionSync()
uri = Soup.URI.new("http://www.google.com";)
m = Soup.Message(uri=uri)
session.send_message(m)
print m.get_uri().to_string(False)
print m.get_property('uri').to_string(False)

Output is
http://www.google.com/
http://www.google.com/

but google definitely redirects. Tested with libsoup-2.42.2

I don't get a redirect when I fetch that URI.

If I fetch "http://google.com/"; with no "www", then it redirects to
"www.google.com", and the URI property on the message gets updated to
reflect that.

-- Dan



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]