Socket
Book a DemoInstallSign in
Socket

simple-http

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-http

0.3.7
bundlerRubygems
Version published
Maintainers
1
Created
Source

simple-http

A really simple HTTP client

  • GET, POST, PUT, DELETE

      require "simple/http"
      http_client = Simple::HTTP.new
      http_client.get "http://google.com" # returns a string
    
  • Exceptions on errors: because, after all, when you consume a HTTP endpoint and don't get a success (20x), then this is an error. Handle it!

      require "simple/http"
      http_client = Simple::HTTP.new
      begin
        http_client.get "http://google.com" # returns a string
      rescue Simple::HTTP::Error
        STDERR.puts "Ooops! #{$!}"
      end
    
  • Caching

      require "simple/http"
      http_client = Simple::HTTP.new
    
      require "active_support/cache"
      require "active_support/cache/file_store"
      http_client.cache = ActiveSupport::Cache::FileStore.new("var/cache")
      http_client.get "http://google.com" # returns a, potentially, cached string
    
  • Automatic de/encoding of JSON payloads

  • Does not requires anything except core ruby classes.

FAQs

Package last updated on 25 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.