Sha256: 77061fd880dba6207a315b4e0ef988bb94a2854d5c9364b55bc0116cb1ffee67

Contents?: true

Size: 523 Bytes

Versions: 4

Compression:

Stored size: 523 Bytes

Contents

module Avo
  module Licensing
    class Request
      class << self
        def post(endpoint, body:, timeout:)
          uri = URI.parse(endpoint)
          http = Net::HTTP.new(uri.host, uri.port)
          http.use_ssl = (uri.scheme == "https")
          http.read_timeout = timeout
          http.open_timeout = timeout
          request = Net::HTTP::Post.new(uri.request_uri, {'Content-Type' => 'application/json'})
          request.body = body
          http.request(request)
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
avo-3.10.6 lib/avo/licensing/request.rb
avo-3.10.5 lib/avo/licensing/request.rb
avo-3.10.4 lib/avo/licensing/request.rb
avo-3.10.3 lib/avo/licensing/request.rb