Class: NationalRailWrapper::Feeds::HistoricalServicePerformance::Requests::Base

Inherits:
Base::Requests::Base
  • Object
show all
Defined in:
lib/national_rail_wrapper/feeds/historical_service_performance/requests/base.rb

Direct Known Subclasses

ServiceDetails, ServiceMetrics

Instance Method Summary collapse

Methods inherited from Base::Requests::Base

#call

Instance Method Details

#base_urlObject



17
18
19
# File 'lib/national_rail_wrapper/feeds/historical_service_performance/requests/base.rb', line 17

def base_url 
  'https://hsp-prod.rockshore.net/api/v1'
end

#request_params(method, body, query, auth_token) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/national_rail_wrapper/feeds/historical_service_performance/requests/base.rb', line 4

def request_params(method, body, query, auth_token)
  {
    method: method,
    body: body.empty? ? '' : body.to_json, 
    params: query, 
    headers: {
      'Content-Type' => 'application/json', 
      "Authorization" => "Basic #{auth_token}"
    }, 
    ssl_verifypeer: false
  }
end