* HttpWebRequest.cs: properties implemented
[mono.git] / mcs / class / System / System.Net / HttpWebResponse.cs
1 //\r
2 // System.Net.HttpWebResponse\r
3 //\r
4 // Author:\r
5 //   Lawrence Pit (loz@cable.a2000.nl)\r
6 //\r
7 \r
8 using System;\r
9 using System.IO;\r
10 using System.Runtime.Serialization;\r
11 \r
12 namespace System.Net \r
13 {\r
14         [Serializable]\r
15         public class HttpWebResponse : WebResponse, ISerializable, IDisposable\r
16         {\r
17                 private Uri uri;\r
18                 private WebHeaderCollection webHeaders;\r
19                 \r
20                 // Constructors\r
21                 \r
22                 protected HttpWebResponse (Uri uri) \r
23                 { \r
24                         this.uri = uri;\r
25                 }\r
26                 \r
27                 protected HttpWebResponse (SerializationInfo serializationInfo, StreamingContext streamingContext)\r
28                 {\r
29                         throw new NotSupportedException ();\r
30                 }\r
31                 \r
32                 // Properties\r
33                 \r
34                 public override long ContentLength {            \r
35                         get { throw new NotSupportedException (); }\r
36                         set { throw new NotSupportedException (); }\r
37                 }\r
38                 \r
39                 public override string ContentType {            \r
40                         get { throw new NotSupportedException (); }\r
41                         set { throw new NotSupportedException (); }\r
42                 }\r
43                 \r
44                 public override WebHeaderCollection Headers {           \r
45                         get { return webHeaders; }\r
46                 }\r
47                 \r
48                 public override Uri ResponseUri {               \r
49                         get { return uri; }\r
50                 }               \r
51 \r
52                 // Methods\r
53                 \r
54                 public override void Close()\r
55                 {\r
56                         throw new NotSupportedException ();\r
57                 }\r
58                 \r
59                 public override Stream GetResponseStream()\r
60                 {\r
61                         throw new NotSupportedException ();\r
62                 }\r
63                 \r
64                 void IDisposable.Dispose()\r
65                 {\r
66                         Close ();\r
67                 }\r
68                 \r
69                 void ISerializable.GetObjectData (SerializationInfo serializationInfo,\r
70                                                   StreamingContext streamingContext)\r
71                 {\r
72                         throw new NotSupportedException ();\r
73                 }               \r
74         }\r
75 }