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

Related Articles

WAK: MQTT for IoT – Brief Documentation

Read about MQTT here. Setting up your scene: 1. Create a GameObject. 2. Add the following scripts: ConnectionBroker, DesktopClient, and…

WAK FAQ [1]

Here are answers to questions a potential user asked recently. Previous: OAuth2 in Unity

OAuth Overview in Unity

Below is one of the OAuth flows available in the WAK OAuth Token Interceptor asset. Next: WAK FAQ 1 Previous: Switching WAK…