Module: Automatic1111::Connection

Included in:
Client
Defined in:
lib/automatic1111/connection.rb

Overview

Network layer for API clients.

Instance Method Summary collapse

Instance Method Details

#delete(url, params: {}, headers: {}) ⇒ Object



29
30
31
# File 'lib/automatic1111/connection.rb', line 29

def delete(url, params: {}, headers: {})
  request :delete, url, params, headers: headers
end

#get(url, params: {}, headers: {}) ⇒ Object



13
14
15
# File 'lib/automatic1111/connection.rb', line 13

def get(url, params: {}, headers: {})
  request :get, url, params, headers: headers
end

#head(url, params: {}, headers: {}) ⇒ Object



33
34
35
# File 'lib/automatic1111/connection.rb', line 33

def head(url, params: {}, headers: {})
  request :head, url, params, headers: headers
end

#last_responseSawyer::Response

Response for last HTTP request

Returns:

  • (Sawyer::Response)


40
41
42
# File 'lib/automatic1111/connection.rb', line 40

def last_response
  @last_response if defined? @last_response
end

#patch(url, params: {}, headers: {}) ⇒ Object



25
26
27
# File 'lib/automatic1111/connection.rb', line 25

def patch(url, params: {}, headers: {})
  request :patch, url, params, headers: headers
end

#post(url, params: {}, headers: {}) ⇒ Object



17
18
19
# File 'lib/automatic1111/connection.rb', line 17

def post(url, params: {}, headers: {})
  request :post, url, params, headers: headers
end

#put(url, params: {}, headers: {}) ⇒ Object



21
22
23
# File 'lib/automatic1111/connection.rb', line 21

def put(url, params: {}, headers: {})
  request :put, url, params, headers: headers
end