I have 4 file upload controls in my website, each of them will access my file server using (HttpWebResponse)Request.GetResponse()
the first upload is fast, but the second upload is very slow, but the third and fourth upload is fast also. All the files are the same. I use (System.Net.HttpWebResponse)Request.GetResponse();
because I want to access/get response a folder in that server.
I check my logs and it turns out that the all upload returns an error The remote server returned an error: (405) Method Not Allowed.
So why in the second upload is slower, it took 20 seconds to get the response, but the rest of request is like a second.
This is my original code:
try
{
Response = (System.Net.HttpWebResponse)Request.GetResponse();
Response.Close();
}
catch (Exception)
{
I already tried setting my Request.Proxy
to null
and also
using (Response = (HttpWebResponse)Request.GetResponse())
{
}
and also
<system.net>
<connectionManagement>
<add address="*" maxconnection="20"/>
</connectionManagement>
</system.net>
and also
httpWebRequest.Abort();
So it turns out that (System.Net.HttpWebResponse)Request.GetResponse();
return an error. How do i close it?