All Projects → Unity3dAzure → Restclient

Unity3dAzure / Restclient

Licence: mit
REST Client for Unity with JSON and XML parsing. (Features JSON helper to handle nested arrays and deserializing abstract types)

Labels

Projects that are alternatives of or similar to Restclient

Pix2pix
Real-time pix2pix implementation with Unity
Stars: ✭ 912 (+2663.64%)
Mutual labels:  unity
Museum
Live coding rig for Channel 18 at SuperDeluxe
Stars: ✭ 30 (-9.09%)
Mutual labels:  unity
Computeshader Unity Macos
Stars: ✭ 31 (-6.06%)
Mutual labels:  unity
Postprocessingdemo
A demo project used in the post-processing stack presentation at Unite 2017 Tokyo.
Stars: ✭ 21 (-36.36%)
Mutual labels:  unity
Kamalitransition
Unity Shader transition between panels
Stars: ✭ 30 (-9.09%)
Mutual labels:  unity
Savegamepro
A Complete and Powerful Save Game Solution for Unity (Game Engine)
Stars: ✭ 30 (-9.09%)
Mutual labels:  unity
Unity File Extension
Shows file extension in 1 column project window.
Stars: ✭ 20 (-39.39%)
Mutual labels:  unity
Freedomengine
Classic Sonic Physics for Unity.
Stars: ✭ 33 (+0%)
Mutual labels:  unity
Resharper Unity
Unity support for both ReSharper and Rider
Stars: ✭ 953 (+2787.88%)
Mutual labels:  unity
Seido
Visuals for Matsuura Masaya's live performance in Osaka and Tokyo.
Stars: ✭ 31 (-6.06%)
Mutual labels:  unity
Unitystationbumper
Video bumper for Unity's live streaming channel.
Stars: ✭ 28 (-15.15%)
Mutual labels:  unity
Turbotrack2d
Prototype of 2D arcade style racing game
Stars: ✭ 30 (-9.09%)
Mutual labels:  unity
Unity Assetpipeline Presentation
Unity project for "A Technical Deep-Dive into Unity's Asset Pipeline" presented at Develop: 2018
Stars: ✭ 31 (-6.06%)
Mutual labels:  unity
Hsplugins
Various Honey Select plugins
Stars: ✭ 21 (-36.36%)
Mutual labels:  unity
Unity Signals
Signals for Unity3D
Stars: ✭ 32 (-3.03%)
Mutual labels:  unity
Kinectwithopencvforunityexample
Kinect with OpenCV for Unity Example
Stars: ✭ 20 (-39.39%)
Mutual labels:  unity
Teapot shooter
Augmented Reality Teapot Shooter made using Unity and ARCore
Stars: ✭ 30 (-9.09%)
Mutual labels:  unity
Dexter
A rich GUI and example code for visualizing and controlling the Dexter robot arm from Haddington Dynamics
Stars: ✭ 32 (-3.03%)
Mutual labels:  unity
Flutter Unity View Widget
Embeddable unity game engine view for Flutter. Advance demo here https://github.com/juicycleff/flutter-unity-arkit-demo
Stars: ✭ 961 (+2812.12%)
Mutual labels:  unity
Falling Words Typing Game
This is the source code for a Falling Words Typing Game created in Unity during a Twitch Livestream.
Stars: ✭ 31 (-6.06%)
Mutual labels:  unity

REST Client for Unity

For Unity developers looking to use REST Services in their Unity game / app.

RESTClient for Unity is built on top of UnityWebRequest and Unity's JsonUtility to make it easier to compose REST requests and return the results serialized as native C# data model objects.

Features

  • Methods to add request body, headers and query strings to REST requests.
  • Ability to return result as native object or as plain text.
  • Work around for nested arrays.
  • Work around for parsing abstract types on UWP.

How do I use this with cloud services?

Checkout the following projects for Unity which were built using this REST Client library as examples.

Example Usage

This snippet shows how to POST a REST request to a new Azure Function HTTP Trigger "hello" sample function:

using RESTClient;
using System;
public class RESTClientExample : MonoBehaviour {

  private string url = "https://***.azurewebsites.net/api/hello"; // Azure Function API endpoint
  private string code = "***"; // Azure Function code

	void Start () {
		StartCoroutine( SayHello(SayHelloCompleted) );
	}

	private IEnumerator SayHello(Action<IRestResponse<string>> callback = null) {
		RestRequest request = new RestRequest(url, Method.POST);
		request.AddHeader("Content-Type", "application/json");
		request.AddQueryParam("code", code);
		request.AddBody("{\"name\": \"unity\"}");
		yield return request.Request.Send();
		request.GetText(callback);
	}

	private void SayHelloCompleted(IRestResponse<string> response) {
		if (response.IsError) {
			Debug.LogError("Request error: " + response.StatusCode);
			return;
		}
		Debug.Log("Completed: " + response.Content);
	}

}

Requirements

Requires Unity v5.3 or greater as UnityWebRequest and JsonUtility features are used. Unity will be extending platform support for UnityWebRequest so keep Unity up to date if you need to support these additional platforms.

Supported platforms

Intended to work on all the platforms UnityWebRequest supports including:

  • Unity Editor (Mac/PC) and Standalone players
  • iOS
  • Android
  • Windows 10 (UWP)

Troubleshooting

  • Remember to wrap async calls with StartCoroutine()
  • Before building for a target platform remember to check the Internet Client capability is enabled in the Unity player settings, otherwise all REST calls will fail with a '-1' status error.

Questions or tweet @deadlyfingers

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].