Skip to content

Commit

Permalink
com.utilities.rest 2.4.5 (#61)
Browse files Browse the repository at this point in the history
- com.utilities.async -> 2.1.2
- com.utilities.extensions - 1.1.15
- updated docs
  • Loading branch information
StephenHodgson authored Dec 31, 2023
1 parent 90d9327 commit e66f9c6
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/upm-subtree-split.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: upm-subtree-split
on:
push:
branches:
- main
- main

jobs:
upm-subtree-split:
Expand All @@ -12,4 +12,5 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: RageAgainstThePixel/upm-subtree-split@v1
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ A Utilities.Rest package for the [Unity](https://unity.com/) Game Engine.

## Installing

Requires Unity 2021.3 LTS or higher.

The recommended installation method is though the unity package manager and [OpenUPM](https://openupm.com/packages/com.utilities.rest).

### Via Unity Package Manager and OpenUPM

- Open your Unity project settings
Expand Down Expand Up @@ -43,6 +47,7 @@ Advanced features includes progress notifications, authentication and native mul
- [Get](#get)
- [Post](#post)
- [Server Sent Events](#server-sent-events)
- [Data Received Callbacks](#data-received-callbacks)
- [Put](#put)
- [Patch](#patch)
- [Delete](#delete)
Expand Down Expand Up @@ -109,6 +114,18 @@ var response = await Rest.PostAsync("www.your.api/endpoint", jsonData, eventData
response.Validate(debug: true);
```

#### Data Received Callbacks

```csharp
var jsonData = "{\"data\":\"content\"}";
var response = await Rest.PostAsync("www.your.api/endpoint", jsonData, dataReceivedEventCallback => {
// eventCallback type is Rest.Response
Debug.Log(dataReceivedEventCallback.Body);
});
// Validates the response for you and will throw a RestException if the response is unsuccessful.
response.Validate(debug: true);
```

### Put

```csharp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Advanced features includes progress notifications, authentication and native mul
- [Get](#get)
- [Post](#post)
- [Server Sent Events](#server-sent-events)
- [Data Received Callbacks](#data-received-callbacks)
- [Put](#put)
- [Patch](#patch)
- [Delete](#delete)
Expand Down Expand Up @@ -109,6 +110,18 @@ var response = await Rest.PostAsync("www.your.api/endpoint", jsonData, eventData
response.Validate(debug: true);
```

#### Data Received Callbacks

```csharp
var jsonData = "{\"data\":\"content\"}";
var response = await Rest.PostAsync("www.your.api/endpoint", jsonData, dataReceivedEventCallback => {
// eventCallback type is Rest.Response
Debug.Log(dataReceivedEventCallback.Body);
});
// Validates the response for you and will throw a RestException if the response is unsuccessful.
response.Validate(debug: true);
```

### Put

```csharp
Expand Down
6 changes: 3 additions & 3 deletions Utilities.Rest/Packages/com.utilities.rest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Utilities.Rest",
"description": "This package contains useful RESTful utilities for the Unity Game Engine.",
"keywords": [],
"version": "2.4.4",
"version": "2.4.5",
"unity": "2021.3",
"documentationUrl": "https://github.com/RageAgainstThePixel/com.utilities.rest#documentation",
"changelogUrl": "https://github.com/RageAgainstThePixel/com.utilities.rest/releases",
Expand All @@ -15,8 +15,8 @@
"author": "Stephen Hodgson",
"url": "https://github.com/StephenHodgson",
"dependencies": {
"com.utilities.async": "2.1.1",
"com.utilities.extensions": "1.1.14",
"com.utilities.async": "2.1.2",
"com.utilities.extensions": "1.1.15",
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.unitywebrequestassetbundle": "1.0.0",
"com.unity.modules.unitywebrequestaudio": "1.0.0",
Expand Down

0 comments on commit e66f9c6

Please sign in to comment.