rageagainstthepixel / com.utilities.rest Goto Github PK
View Code? Open in Web Editor NEWRESTful utilities for the Unity (UPM)
License: MIT License
RESTful utilities for the Unity (UPM)
License: MIT License
From the example given in the ReadMe, this highlights a signature conflict for the PostAsync call between:
public static async Task<Response> PostAsync(
string query,
string jsonData,
Action<string> serverSentEventCallback,
RestParameters parameters = null,
CancellationToken cancellationToken = default)
And
public static async Task<Response> PostAsync(
string query,
string jsonData,
Action<Response> dataReceivedEventCallback,
int? eventChunkSize = null,
RestParameters parameters = null,
CancellationToken cancellationToken = default)
Likely due to the defaults applied to the second method.
Steps to reproduce the behavior:
var jsonData = "{\"data\":\"content\"}";
var response = await Rest.PostAsync("www.your.api/endpoint", jsonData, eventData =>
{
Debug.Log(eventData);
});
Examples should work out of the box, as should all method overloads.
This Unity error is thrown when I use this plugin. It appears to be because webrequest upload/download handlers aren't disposed.
The reason for this is apparently because PostAsync calls UnityWebRequest.Post, which creates uploadHandler/downloadHandler. Those handlers are then overwritten but never disposed.
Additionally, you may need to add webRequest.disposeUploadHandlerOnDispose/webRequest.disposeDownloadHandlerOnDispose?
More info on that here: https://forum.unity.com/threads/a-native-collection-has-not-been-disposed-resulting-in-a-memory-leak.1136068/
When using the Post functions, DownloadHandlerBuffer is used for the downloadHandler. This results in text not being returned.
I'm not sure if this is by design or not?
Seeing this error when installing via Github URL:
[Package Manager Window] Cannot perform upm operation: Unable to add package [https://github.com/RageAgainstThePixel/com.utilities.rest.git#upm]:
Package com.utilities.rest@https://github.com/RageAgainstThePixel/com.utilities.rest.git#upm has invalid dependencies or related test packages:
com.utilities.async (dependency): Package [[email protected]] cannot be found [NotFound].
Some plugins seem to have problems loading resources from cache location.
Need to double check that webgl supports writing files to a local cache before attempting to load the resource.
currently missing PATCH operations
With all the recent changes, the main ReadMe has not been kept up to date, as such, none of the examples provided are functional and require additional parameters.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.