I'm making an app in unity and I need to download a file. I'm using the following code to get header values:
HttpWebRequest request = (HttpWebRequest)System.Net.WebRequest.Create(remoteFile);
request.Method = "HEAD";
HttpWebResponse resp = null;
try {
resp = request.GetResponse() as HttpWebResponse;
}catch (System.Exception e) {
Debug.LogWarning("ERROR: " + e);
return;
}
This code worked for some files, but I'm hosting a file on ge.tt, and it doesn't work on it. The link I gave it starts the download immediately in chrome.
The error is:
ERROR: System.Net.WebException: The remote server returned an error: (404) Not Found.
at System.Net.HttpWebRequest.CheckFinalStatus (System.Net.WebAsyncResult result)
Does anyone know why is this happening?
Thank you!