0

So I'm currently trying to get a redirected URL from one of my original URLs.

The problem is, when I send an HTTP request through ruby to one of the original URLs, I initially get a response with code 200 and thats it.

However, if I check it in the browser, after calling the original URL, it waits for a split second and redirects automatically to get a new URL. I'd like to have this new redirected URL from my ruby code.

Any suggestions?

Sandeep Garg
  • 1,292
  • 1
  • 13
  • 31
Pragun
  • 1,123
  • 8
  • 20
  • Pragun Joshi, have a look at this https://stackoverflow.com/questions/4867652/how-can-i-get-the-final-url-after-redirects-using-ruby or https://stackoverflow.com/questions/5872210/get-redirect-of-a-url-in-ruby – Subash Jun 25 '18 at 05:28
  • Hello dai. :) For some reason this didn't work for me. I'll re-check if there was anything wrong. – Pragun Jun 25 '18 at 05:30
  • Howdy Pragun :) should be pretty straight forward, have a look anyway – Subash Jun 25 '18 at 05:31
  • Can you show the code you are using? – Jagdeep Singh Jun 25 '18 at 09:40
  • from a little research it turns out the page i'm requesting is using a body onload function to redirect using js. so i should be closing the question i guess. – Pragun Jun 25 '18 at 09:42

0 Answers0