lib/film_on/base.rb
# Make a POST request to the api with the given service, query and protocol
#
Make a POST request to the api with the given service, query and protocol
Make a POST request to the api with the given service query and protocol
def post(service, query={}, protocol="http://")
      query["format"] = "json"
      query["session_key"] = @session_key unless service == "init"
      response = HTTParty.post("#{protocol}#{TV_URI}#{service}", {body: query, headers: {'Content-Type' => 'application/json'}})
      if response && response.code == 200
        return response.body
      else
        raise ApiError
      end
    end
def post ( service , query = { } , protocol = "http://" ) query [ "format" ] = "json" query [ "session_key" ] = @session_key unless service == "init" response = HTTParty . post ( "#{protocol}#{TV_URI}#{service}" , { body : query , headers : { 'Content-Type' => 'application/json' } } ) if response && response . code == 200 return response . body else raise ApiError end end
Make a POST request to the api with the given service, query and protocol
Make a POST request to the api with the given service query and protocol
service
<not_specific>
query
<not_specific>
protocol
<not_specific>