lib/starling/api_service.rb
# Makes an HTTP request to the Starling Bank API with the specified method and path
#
# @param method [Symbol] The HTTP method which will be used for the request
# @param path [String] The path of the API endpoint, which will be appended to the
#                      {BASE_PATH}
# @param params [Hash] The parameters which will be included in the request, either
#                      in the URL or the body, depending on the method
# @param headers [Hash] Additional headers to be included in your request, which will
#                       be merged on top of the service's default headers
# @return [Faraday::Response] The response from the server to the dispatched request
Makes an HTTP request to the Starling Bank API with the specified method and path
Makes an HTTP request to the Starling Bank API with the specified method and path
def make_request(method, path, params: {}, headers: {})
      headers = @headers.merge(headers)
      Request.new(@connection, method, build_path(path), params: params,
                                                         headers: headers)
             .make_request
    end
def make_request ( method , path , params : { } , headers : { } ) headers = @headers . merge ( headers ) Request . new ( @connection , method , build_path ( path ) , params : params , headers : headers ) . make_request end
Makes an HTTP request to the Starling Bank API with the specified method and path
Makes an HTTP request to the Starling Bank API with the specified method and path
The response from the server to the dispatched request
The response from the server to the dispatched request
Faraday::Response
method
The HTTP method which will be used for the request
The HTTP method which will be used for the request
path
The path of the API endpoint, which will be appended to the {BASE_PATH}
The path of the API endpoint which will be appended to the { BASE_PATH }
params
The parameters which will be included in the request, either in the URL or the body, depending on the method
The parameters which will be included in the request either in the URL or the body depending on the method
headers
Additional headers to be included in your request, which will be merged on top of the service's default headers
Additional headers to be included in your request which will be merged on top of the service ' s default headers