Giter Site home page Giter Site logo

com.utilities.rest's Issues

PostAsync has a signature conflict

Overview

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.

To Reproduce

Steps to reproduce the behavior:

  1. Create a new script
  2. Copy the Rest example from the readme
      var jsonData = "{\"data\":\"content\"}";
      var response = await Rest.PostAsync("www.your.api/endpoint", jsonData, eventData =>
      {
          Debug.Log(eventData);
      });
  1. Observe conflict error

image

Expected behavior

Examples should work out of the box, as should all method overloads.

Download handlers are not properly disposed

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/

Can't install!

Bug Report

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].

Ensure Cache works properly on WebGL Builds

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.

PATCH

Feature Request

currently missing PATCH operations

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.