Class: DiasporaFederation::HttpClient

Inherits:
Object
  • Object
show all
Defined in:
lib/diaspora_federation/http_client.rb

Overview

A wrapper for Faraday

Class Method Summary collapse

Class Method Details

.connectionFaraday::Connection

Gets the Faraday connection

Returns:

  • (Faraday::Connection)

    the response



23
24
25
26
# File 'lib/diaspora_federation/http_client.rb', line 23

def self.connection
  create_default_connection unless @connection
  @connection.dup
end

.get(uri) ⇒ Faraday::Response

Perform a GET request

Parameters:

  • uri (String)

    the URI

Returns:

  • (Faraday::Response)

    the response



16
17
18
# File 'lib/diaspora_federation/http_client.rb', line 16

def self.get(uri)
  connection.get(uri)
end