What is the most efficient way to get the content-type of a given URL using Ruby?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is what I’d do if I want simple code:
The big advantage is it follows redirects.
If you’re checking a bunch of URLs you might want to call
closeon the handles after you’ve found what you want.