toshi0383 / TVMLKitchen

Swifty TVML template manager with or without client-server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom HTTP Header

toshi0383 opened this issue · comments

We should make HTTP Header fields customisable when Kitchen requests TVML on Network.
Workaround for now is to send network request by yourself, then pass the response XML string to Kitchen.

I think we need to introduce these to archive this goal.

  • Pass HTTP Header parameter via Cookbook object.
  • Pass Response object handler (type should be NSHTTPURLResponse -> Bool) via Cookbook object. Devs can return false if response is invalid, and don't want to proceed to xml parsing.

IMO, we should not let TVJS to send network requests (by TVJS's evaluateScripts) anymore. So the custom configuration above would affect every network requests in Kitchen.
Therefore, template URL should not be path for js file anymore, but for xml file.