Switching providers

By default, each WAK HTTPOperation uses Unity’s WWW/UnityWebRequest 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 on the asset store and require the actual asset: https://assetstore.unity.com/publishers/1758

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.

Switching providers