Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

Networking [Case 750104] UnityWebRequest issues

Discussion in '5.3 Beta' started by Novack, Dec 3, 2015.

  1. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    613
    I was getting an issue using the UnityWebRequest.Post method, described on this thread.

    It turns out that UnityWebRequest.redirectLimit is not working as expected for -at least- the UnityWebRequest.Post() method.

    The docs read about redirectLimit:

    If you wish to disable redirects altogether, set this property to zero.

    However, doing a POST request using UnityWebRequest.Post(), will follow 302 redirects regardless of UnityWebRequest.redirectLimit = 0;

    Then there is a second problem, UnityWebRequest.Post() asumes redirections maintain the POST method, when it may not be the case. In my original issue the initial request was using POST, but the redirection was expecting a GET request. Im not sure this is compliant with the standard, but is the reality of the vast majority of 302 implementations out there.

    I raised a bug report for my original issue, [Case 750104], yet this is the most accurate description of the base problems.
     
  2. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    613
    Have also noted that there is apparently no way of knowing about the redirections that are happening. Have been checking UnityWebRequest.responseCode but it only holds the latest. This happens in other situations, is all "fire and forget": UnityWebRequest is better than WWW, but we are still blindfolded as to what is happening.

    In essence, we would be nice having some tools for debugging. A verbose flag for reading how the request looks in full for each method, the number of hops in the redirection, the intermediate code types returned on each hop...