Class: Firebase::Admin::Internal::HTTPClient

Inherits:
Object
  • Object
show all
Defined in:
lib/firebase/admin/internal/http_client.rb

Overview

A class to work with

Constant Summary collapse

USER_AGENT =

The admin sdk user agent.

"Firebase/HTTP/#{VERSION}/#{RUBY_VERSION}/AdminRuby"

Instance Method Summary collapse

Constructor Details

#initialize(uri: nil, credentials: nil) ⇒ HTTPClient

Returns a new instance of HTTPClient.



12
13
14
15
# File 'lib/firebase/admin/internal/http_client.rb', line 12

def initialize(uri: nil, credentials: nil)
  @uri = uri ? Faraday::Utils::URI(uri) : nil
  @credentials = credentials
end

Instance Method Details

#delete(url = nil, params = nil, headers = nil) ⇒ Object



25
26
27
# File 'lib/firebase/admin/internal/http_client.rb', line 25

def delete(url = nil, params = nil, headers = nil)
  connection.delete(url, params, headers)
end

#get(url = nil, params = nil, headers = nil) ⇒ Object



21
22
23
# File 'lib/firebase/admin/internal/http_client.rb', line 21

def get(url = nil, params = nil, headers = nil)
  connection.get(url, params, headers)
end

#head(url = nil, params = nil, headers = nil) ⇒ Object



17
18
19
# File 'lib/firebase/admin/internal/http_client.rb', line 17

def head(url = nil, params = nil, headers = nil)
  connection.head(url, params, headers)
end

#patch(url = nil, params = nil, headers = nil) ⇒ Object



41
42
43
# File 'lib/firebase/admin/internal/http_client.rb', line 41

def patch(url = nil, params = nil, headers = nil)
  connection.patch(url, params, headers)
end

#post(url = nil, params = nil, headers = nil) ⇒ Object



37
38
39
# File 'lib/firebase/admin/internal/http_client.rb', line 37

def post(url = nil, params = nil, headers = nil)
  connection.post(url, params.to_json, headers)
end

#put(url = nil, params = nil, headers = nil) ⇒ Object



33
34
35
# File 'lib/firebase/admin/internal/http_client.rb', line 33

def put(url = nil, params = nil, headers = nil)
  connection.put(url, params, headers)
end

#trace(url = nil, params = nil, headers = nil) ⇒ Object



29
30
31
# File 'lib/firebase/admin/internal/http_client.rb', line 29

def trace(url = nil, params = nil, headers = nil)
  connection.trace(url, params, headers)
end