HTTParty.head 检索 MP3 的完整响应
HTTParty.head retrieves full response for MP3
我正在使用 HTTParty 检查一些 mp3 的健康状况,所以我只想发出一个 head 请求并查看响应代码。但是,当我在 mp3 上使用 HTTParty.head 时,我收到了完整的回复。
例如,response = HTTParty.head("https://archive.org/download/is-los-angeles-still-a-city-of-quartz.LYaAW6.popuparchive.org/ww_2015-06-18-202413.6929.mp3")
使用 curl 按预期工作curl -IL https://archive.org/download/is-los-angeles-still-a-city-of-quartz.LYaAW6.popuparchive.org/ww_2015-06-18-202413.6929.mp3
Here's 您在 GitHub 上寻找的问题。答案之一有效(似乎是重定向的问题):
HTTParty.head("https://archive.org/download/is-los-angeles-still-a-city-of-quartz.LYaAW6.popuparchive.org/ww_2015-06-18-202413.6929.mp3", follow_redirects: true, maintain_method_across_redirects: true)
我正在使用 HTTParty 检查一些 mp3 的健康状况,所以我只想发出一个 head 请求并查看响应代码。但是,当我在 mp3 上使用 HTTParty.head 时,我收到了完整的回复。
例如,response = HTTParty.head("https://archive.org/download/is-los-angeles-still-a-city-of-quartz.LYaAW6.popuparchive.org/ww_2015-06-18-202413.6929.mp3")
使用 curl 按预期工作curl -IL https://archive.org/download/is-los-angeles-still-a-city-of-quartz.LYaAW6.popuparchive.org/ww_2015-06-18-202413.6929.mp3
Here's 您在 GitHub 上寻找的问题。答案之一有效(似乎是重定向的问题):
HTTParty.head("https://archive.org/download/is-los-angeles-still-a-city-of-quartz.LYaAW6.popuparchive.org/ww_2015-06-18-202413.6929.mp3", follow_redirects: true, maintain_method_across_redirects: true)