Skip to content
forked from abril/browsah

this is not a HTTP request lib like the ones you see around, it is REAL BROWSAH!

License

Notifications You must be signed in to change notification settings

grubster/browsah

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

It's a REAL BROWSAH!!!1!

Unlike other HTTP client libraries, browsah aims to be a true browser.

Sample Code

Simple POST/GET:

require 'browsah'
require 'json'

headers = { 'Content-Type' => 'application/json' }
body    = { "longUrl" => "http://engineering.abril.com.br" }.to_json
bw      = Browsah.new('https://www.googleapis.com')

bw.post '/urlshortener/v1/url', :body => body, :headers => headers do |r|
  r.on(200) do
    parsed = JSON.parse(r.body)
    jj parsed
  end
end

bw.get '/urlshortener/v1/url?shortUrl=http://goo.gl/TT1LT' do |r|
  r.on(200) do
    parsed = JSON.parse(r.body)
    jj parsed
  end
end

License

browsah is licensed under the BSD License.

See LICENSE file for details.

About

this is not a HTTP request lib like the ones you see around, it is REAL BROWSAH!

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%