認証を介してFacebookのアバターを取得しようとしています。これが私がやっていることです:
def image_uri
require 'net/http'
image = URI.parse(params[:image]) # https://graph.facebook.com/565515262/picture
fetch = Net::HTTP.get_response(image)
based = 'data:image/jpg;base64,' << Base64.encode64(fetch)
render :text => based
end
次のエラーが表示されます (新しいエラー — 編集済み):
Connection reset by peer
グーグルで調べてみましたが、解決策が得られないようです。アイデアはありますか?
私は基本的にPHPの正確な機能を探していますfile_get_contents()