Ruby Net::HTTP - following 301 redirects

前端 未结 5 749
时光说笑
时光说笑 2020-12-05 04:36

My users submit urls (to mixes on mixcloud.com) and my app uses them to perform web requests.

A good url returns a 200 status code:

         


        
5条回答
  •  时光说笑
    2020-12-05 05:01

    I can't figure out how to comment on the accepted answer (this question might be closed), but I should note that r.header is now obsolete, so r.header['location'] should be replaced by r['location'] (per https://stackoverflow.com/a/6934503/1084675 )

提交回复
热议问题