Sha256: f01e127f042e407fa82e0ebd50d398e5dbc8e43e1a997da99fabd6f8d4b17160
Contents?: true
Size: 659 Bytes
Versions: 11
Compression:
Stored size: 659 Bytes
Contents
module AppleNews module Request class Delete attr_reader :url def initialize(url) @config = AppleNews.config @url = URI::parse(File.join(@config.api_base, url)) end def call(params = {}) http = Net::HTTP.new(@url.hostname, @url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_PEER res = http.delete(@url, headers) res.code == '204' ? true : JSON.parse(res.body) end private def headers security = AppleNews::Security.new('DELETE', @url.to_s) { 'Authorization' => security.authorization } end end end end
Version data entries
11 entries across 11 versions & 1 rubygems