Switching WAK Provider

By default, each WAK HTTPOperation uses Unity’s WWW class to communicate over the wire.  There are other, more robust, HTTP libraries out there and are fully supported in WAK.  A couple reasons why you would want to use a library such as BestHTTP, UniWeb, or UnityHTTP are:

  • WWW class is limited to the GET and POST verbs
  • WWW class does not include the body of the response if HTTP status code is other than 200

All providers can be found below and require the actual asset.

Switching providers is easy… Add the HttpProvider attribute to the HTTPOperation class and specify one of the available types in the ‘hg.ApiWebKit.providers’ namespace.  Now, this example is using UnityHTTP instead of Unity WWW class.  That is all there is to it.

Screen Shot 2015-07-13 at 5.15.51 PM

 

Next: OAuth Overview in Unity

Previous: Modeling WAK Responses