Skip to content

Commit

Permalink
Updated readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
timcassell committed May 18, 2023
1 parent 0332851 commit 5cbec96
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ RestClient.GetArray<Post>(api + "/posts").Then(response => {
return RestClient.GetArray<User>(api + "/users");
}).Then(response => {
EditorUtility.DisplayDialog ("Success", JsonHelper.ArrayToJson<User>(response, true), "Ok");
}).Catch(err => EditorUtility.DisplayDialog ("Error", err.Message, "Ok"));
}).Catch((RequestException err) => EditorUtility.DisplayDialog ("Error", err.Message, "Ok"));
```

## Features 🎮
Expand All @@ -51,7 +51,7 @@ RestClient.GetArray<Post>(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 🦄
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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");
});
Expand All @@ -182,7 +182,7 @@ RestClient.Get(new RequestHelper {
AudioSource audio = GetComponent<AudioSource>();
audio.clip = ((DownloadHandlerAudioClip)res.Request.downloadHandler).audioClip;
audio.Play();
}).Catch(err => {
}).Catch((RequestException err) => {
EditorUtility.DisplayDialog ("Error", err.Message, "Ok");
});
```
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 5cbec96

Please sign in to comment.