lib/gameball/utils/request.rb in gameball-1.0.0 vs lib/gameball/utils/request.rb in gameball-1.0.1

- old
+ new

@@ -1,10 +1,10 @@ module Gameball module Utils extend self - def request(verb, path, body = {}) + def request(verb, path, body = {},lang="") # check for api_version and key and throw error if not included if !Gameball.api_key raise Gameball::GameballError.new("Please provide the api_key before making a request, try Gameball::api_key='your_key'") end uri = URI(Gameball.api_base + "/api" + "/" + Gameball.api_version + path) @@ -27,9 +27,12 @@ else raise Gameball::GameballException.new("Please provide a valid HTTP Verb") # will later throw an exception end if body != {} req.body = body.to_json + end + if lang!="" + req["lang"]=lang end req["APIKey"] = Gameball.api_key res = https.request(req) return res end