class ShopifyAPI::Clients::HttpRequest

Public Instance Methods

verify() click to toggle source
# File lib/shopify_api/clients/http_request.rb, line 18
def verify
  unless [:get, :delete, :put, :post].include?(http_method)
    raise ShopifyAPI::Errors::InvalidHttpRequestError, "Invalid Http method #{http_method}."
  end

  if body && !body_type
    raise ShopifyAPI::Errors::InvalidHttpRequestError, "Cannot set a body without also setting body_type."
  end

  return unless [:put, :post].include?(http_method)

  unless  body
    raise ShopifyAPI::Errors::InvalidHttpRequestError, "Cannot use #{http_method} without specifying data."
  end
end