diff --git a/README.md b/README.md index 17f1a48..ee449ab 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ RestClient.GetArray(api + "/posts").Then(response => { return RestClient.GetArray(api + "/users"); }).Then(response => { EditorUtility.DisplayDialog ("Success", JsonHelper.ArrayToJson(response, true), "Ok"); -}).Catch(err => EditorUtility.DisplayDialog ("Error", err.Message, "Ok")); +}).Catch((RequestException err) => EditorUtility.DisplayDialog ("Error", err.Message, "Ok")); ``` ## Features 🎮 @@ -51,7 +51,7 @@ RestClient.GetArray(api + "/posts").Then(response => { - Automatic transforms for **JSON Arrays**. - Supports default **HTTP** Methods **(GET, POST, PUT, DELETE, HEAD, PATCH)** - Generic **REQUEST** method to create any http request -- Based on **Promises** for a better asynchronous programming. Learn about Promises [here](https://github.com/Real-Serious-Games/C-Sharp-Promise)! +- Based on **Promises** for a better asynchronous programming. Learn about Promises [here](https://github.com/timcassell/ProtoPromise)! - Utility to work during scene transition - Handle HTTP exceptions and retry requests easily - Open Source 🦄 @@ -80,7 +80,7 @@ Do you want to see this beautiful package in action? Download the demo [here](ht Download and install the **.unitypackage** file of the latest release published [here](https://github.com/proyecto26/RestClient/releases). ### UPM package -Make sure you had installed [C# Promise package](https://openupm.com/packages/com.rsg.promise/) or at least have it in your [openupm scope registry](https://openupm.com/). Then install **RestClient package** using this URL from **Package Manager**: `https://github.com/proyecto26/RestClient.git#upm` +Make sure you had installed [ProtoPromise package](https://openupm.com/packages/com.timcassell.protopromise/) or at least have it in your [openupm scope registry](https://openupm.com/). Then install **RestClient package** using this URL from **Package Manager**: `https://github.com/proyecto26/RestClient.git#upm` ### NuGet package Other option is download this package from **NuGet** with **Visual Studio** or using the **nuget-cli**, a **[NuGet.config](https://github.com/proyecto26/RestClient/blob/master/demo/NuGet.config)** file is required at the root of your **Unity Project**, for example: @@ -164,7 +164,7 @@ RestClient.Request(new RequestHelper { AssetBundle assetBundle = ((DownloadHandlerAssetBundle)response.Request.downloadHandler).assetBundle; EditorUtility.DisplayDialog("Status", response.StatusCode.ToString(), "Ok"); -}).Catch(err => { +}).Catch((RequestException err) => { var error = err as RequestException; EditorUtility.DisplayDialog("Error Response", error.Response, "Ok"); }); @@ -182,7 +182,7 @@ RestClient.Get(new RequestHelper { AudioSource audio = GetComponent(); audio.clip = ((DownloadHandlerAudioClip)res.Request.downloadHandler).audioClip; audio.Play(); -}).Catch(err => { +}).Catch((RequestException err) => { EditorUtility.DisplayDialog ("Error", err.Message, "Ok"); }); ``` @@ -319,6 +319,7 @@ router.post('/', function(req, res) { ``` ## Credits 👍 +* **ProtoPromise** [Robust and efficient library for management of asynchronous operations.](https://github.com/timcassell/ProtoPromise) * **C-Sharp-Promise:** [Promises library for C# for management of asynchronous operations.](https://github.com/Real-Serious-Games/C-Sharp-Promise) * **MyAPI:** [A template to create awesome APIs easily ⚡️](https://github.com/proyecto26/MyAPI)