|
|
@@ -142,11 +142,15 @@ namespace System.Net
|
|
|
#if NET_2_0
|
|
|
public
|
|
|
#endif
|
|
|
- byte [] DownloadData (Uri address)
|
|
|
+ byte [] DownloadData (Uri address, string method)
|
|
|
{
|
|
|
- return DownloadData (address, "GET");
|
|
|
+ WebRequest request = SetupRequest (address, method);
|
|
|
+ request.Method = method;
|
|
|
+ WebResponse response = request.GetResponse ();
|
|
|
+ Stream st = ProcessResponse (response);
|
|
|
+ return ReadAll (st, (int) response.ContentLength);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
#if NET_2_0
|
|
|
public
|
|
|
#endif
|
|
|
@@ -156,17 +160,12 @@ namespace System.Net
|
|
|
}
|
|
|
|
|
|
#if NET_2_0
|
|
|
- public
|
|
|
-#endif
|
|
|
- byte [] DownloadData (Uri address, string method)
|
|
|
+ public byte [] DownloadData (Uri address)
|
|
|
{
|
|
|
- WebRequest request = SetupRequest (address, method);
|
|
|
- request.Method = method;
|
|
|
- WebResponse response = request.GetResponse ();
|
|
|
- Stream st = ProcessResponse (response);
|
|
|
- return ReadAll (st, (int) response.ContentLength);
|
|
|
+ return DownloadData (address, "GET");
|
|
|
}
|
|
|
-
|
|
|
+#endif
|
|
|
+
|
|
|
public void DownloadFile (string address, string fileName)
|
|
|
{
|
|
|
DownloadFile (MakeUri (address), fileName);
|