BigBinary BlogWe craft blog posts about what we have learned so far and we have published 608 blog posts about Ruby on Rails, ReactJS, React Native, open source, engineering & design.

When working on the Shrine library for handling file uploads, in multiple places I needed to be able to download a file from URL. If you know the Ruby standard library well, the solution might be obvious to you: open-uri. require "open-uri" result = open("http://example.com/image.jpg") result #=> #<Tempfile:/var/folders/k7/6zx6dx6x7ys3rv3srh0nyfj00000gn/T/20160524-10403-xpdakz> Open-uri is somethi
タイトル長えw さて、HTTP リクエストするとJSON が返ってくるようなAPI でなんやかんや処理をすることが割りとよくあるのだが、すぐに忘れてしまうのでメモメモ。 https://api.example.com/smaple.json にHTTP GET リクエストを投げるとJSON が返ってくる場合を想定します。 Net::HTTP を使うとこんなふうに書ける。 require require 'net/http' require 'uri' require 'json' uri = URI.parse('https://api.example.com/smaple.json') https = Net::HTTP.new(uri.host, uri.port) https.use_ssl = true res = https.start { https.get(uri.reque
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く