title: Generic/Unknown HTTP Error with response code 0 using UnityWebRequest
body: <p>I was trying to use some server's API functions, and suddenly came to this error. I will explain it after the code sample:</p>
  
  <pre><code>public IEnumerator Post(Dictionary&lt;string, string&gt; data)
      {
          var request = UnityWebRequest.Post(Url, data);
          request.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  
          yield return request.Send();
  
          if (request.isError)
             UpdateNetworkLog("Network error has occured: " + request.error);
          else
              // Some code after success
      }
  </code></pre>
  
  <p>As you can see, mostly I took it from the Unity manual considering POST requests <a href="https://docs.unity3d.com/Manual/UnityWebRequest-SendingForm.html" rel="noreferrer">here</a>. But, there is one problem - the request never finished correctly, it always has error (which is shown using UpdateNetworkLog function): "Generic/unknown HTTP error", while request's response code is 0. Also, I've tried to use legacy method from this manual and WWW class getting the same result.</p>
  
  <p>I think, problem is in how Unity gets the response: I have checked packets via Wireshark, both my POST request and server's response are perfectly fine, no errors or mistakes.</p>
  
  <p>Another important issue is that I'm using WebGL, and everything's all right in Editor, program gets the proper response and works correctly; error appears only after I build and run the game in the browser (tested in Chrome and Safari). Also, tried launch it using not the Unity WebGL Player, but XAMPP: the same.</p>
  
  <p>Thanks for all the future responses, as Google does not know anything about it.</p>