In a Rails app, I'd like to make a HTTP HEAD request for a resource (a user-provided URL), to make sure that it exists. I'd also like a timeout, to ensure that the method fails after spending a reasonable period of time waiting. What is the most straightforward way to accomplish this (using the standard library, if possible)?
相关问题
- Angular RxJS mergeMap types
- Question marks after images and js/css files in ra
- Using :remote => true with hover event
- Google Apps Script: testing doPost() with cURL
- How to instantiate Http service in main.ts manuall
相关文章
- C#使用http访问网络,有办法用指定网卡访问网络嘛?
- Ruby using wrong version of openssl
- Right way to deploy Rails + Puma + Postgres app to
- AWS S3 in rails - how to set the s3_signature_vers
- Difference between Thread#run and Thread#wakeup?
- how to call a active record named scope with a str
- How to add a JSON column in MySQL with Rails 5 Mig
- “No explicit conversion of Symbol into String” for
Try this snippet:
Hope this is what you're looking for.
UPDATE
Because there is
head
method that looks likeYou can also use this snippet: