class Mailgun::Client

def get(resource_path, params = {}, accept = '*/*')

Raises:
  • (CommunicationError) - If the request fails, raises a communication error.

Returns:
  • (Mailgun::Response) - A response object containing the API response data.

Parameters:
  • accept (String) -- The expected Content-Type of the response. Defaults to '*/*'.
  • params (Hash) -- Optional request parameters, including query parameters and headers.
  • resource_path (String) -- The API resource path to request, including the domain if required.
def get(resource_path, params = {}, accept = '*/*')
  headers = (params[:headers] || {}).merge(accept: accept)
  response = @http_client.get(resource_path, params, headers)
  Response.new(response)
rescue => err
  raise communication_error(err)
end