2 // System.Net.HttpWebRequest
5 // Rolf Bjarne Kvinge <rolf@xamarin.com>
7 // Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
9 // Permission is hereby granted, free of charge, to any person obtaining
10 // a copy of this software and associated documentation files (the
11 // "Software"), to deal in the Software without restriction, including
12 // without limitation the rights to use, copy, modify, merge, publish,
13 // distribute, sublicense, and/or sell copies of the Software, and to
14 // permit persons to whom the Software is furnished to do so, subject to
15 // the following conditions:
17 // The above copyright notice and this permission notice shall be
18 // included in all copies or substantial portions of the Software.
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
24 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
25 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 using System.Net.Security;
31 using System.Runtime.Serialization;
32 using System.Security.Cryptography.X509Certificates;
37 public class HttpWebRequest : WebRequest, ISerializable
39 internal const string EXCEPTION_MESSAGE = "System.Net.HttpWebRequest is not supported on the current platform.";
41 internal WebConnection WebConnection {
42 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
43 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
51 HttpWebRequest (Uri uri)
53 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
56 internal HttpWebRequest (Uri uri, object /* IMonoTlsProvider */ tlsProvider, object /* MonoTlsSettings */ settings = null)
58 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
61 protected HttpWebRequest (SerializationInfo serializationInfo, StreamingContext streamingContext)
63 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
66 public string Accept {
67 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
68 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
72 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
75 public bool AllowAutoRedirect {
76 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
77 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
80 public bool AllowWriteStreamBuffering {
81 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
82 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
85 public virtual bool AllowReadStreamBuffering {
86 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
87 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
90 public DecompressionMethods AutomaticDecompression {
91 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
92 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
95 internal bool InternalAllowBuffering {
96 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
99 internal Mono.Net.Security.IMonoTlsProvider TlsProvider {
100 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
103 internal Mono.Security.Interface.MonoTlsSettings TlsSettings {
104 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
107 public X509CertificateCollection ClientCertificates {
108 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
109 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
112 public string Connection {
113 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
114 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
117 public override string ConnectionGroupName {
118 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
119 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
122 public override long ContentLength {
123 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
124 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
127 internal long InternalContentLength {
128 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
131 public override string ContentType {
132 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
133 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
136 public HttpContinueDelegate ContinueDelegate {
137 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
138 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
141 public virtual CookieContainer CookieContainer {
142 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
143 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
146 public override ICredentials Credentials {
147 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
148 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
151 public DateTime Date {
152 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
153 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
157 public static new RequestCachePolicy DefaultCachePolicy {
158 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
159 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
163 public static int DefaultMaximumErrorResponseLength {
164 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
165 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
168 public string Expect {
169 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
170 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
173 public virtual bool HaveResponse {
174 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
177 public override WebHeaderCollection Headers {
178 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
179 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
183 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
184 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
187 public DateTime IfModifiedSince {
188 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
189 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
192 public bool KeepAlive {
193 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
194 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
197 public int MaximumAutomaticRedirections {
198 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
199 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
202 public int MaximumResponseHeadersLength {
203 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
204 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
207 public static int DefaultMaximumResponseHeadersLength {
208 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
209 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
212 public int ReadWriteTimeout {
213 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
214 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
217 public int ContinueTimeout {
218 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
219 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
222 public string MediaType {
223 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
224 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
227 public override string Method {
228 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
229 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
232 public bool Pipelined {
233 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
234 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
237 public override bool PreAuthenticate {
238 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
239 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
242 public Version ProtocolVersion {
243 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
244 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
247 public override IWebProxy Proxy {
248 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
249 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
252 public string Referer {
253 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
254 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
257 public override Uri RequestUri {
258 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
261 public bool SendChunked {
262 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
263 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
266 public ServicePoint ServicePoint {
267 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
270 internal ServicePoint ServicePointNoLock {
271 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
274 public virtual bool SupportsCookieContainer {
275 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
278 public override int Timeout {
279 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
280 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
283 public string TransferEncoding {
284 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
285 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
288 public override bool UseDefaultCredentials {
289 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
290 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
293 public string UserAgent {
294 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
295 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
298 public bool UnsafeAuthenticatedConnectionSharing {
299 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
300 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
303 internal bool ExpectContinue {
304 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
305 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
308 internal ServerCertValidationCallback ServerCertValidationCallback {
309 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
312 internal Uri AuthUri {
313 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
316 public RemoteCertificateValidationCallback ServerCertificateValidationCallback {
317 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
318 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
321 public void AddRange (int range)
323 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
326 public void AddRange (int from, int to)
328 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
331 public void AddRange (string rangeSpecifier, int range)
333 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
336 public void AddRange (string rangeSpecifier, int from, int to)
338 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
341 public void AddRange (long range)
343 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
346 public void AddRange (long from, long to)
348 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
351 public void AddRange (string rangeSpecifier, long range)
353 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
356 public void AddRange (string rangeSpecifier, long from, long to)
358 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
361 public override IAsyncResult BeginGetRequestStream (AsyncCallback callback, object state)
363 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
366 public override Stream EndGetRequestStream (IAsyncResult asyncResult)
368 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
371 public override Stream GetRequestStream()
373 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
376 public override IAsyncResult BeginGetResponse (AsyncCallback callback, object state)
378 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
381 public override WebResponse EndGetResponse (IAsyncResult asyncResult)
383 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
386 public Stream EndGetRequestStream (IAsyncResult asyncResult, out TransportContext transportContext)
388 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
391 public override WebResponse GetResponse()
393 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
396 internal bool FinishedReading {
397 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
398 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
401 internal bool Aborted {
402 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
405 public override void Abort ()
407 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
410 void ISerializable.GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)
412 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
415 protected override void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)
417 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
420 internal void DoContinueDelegate (int statusCode, WebHeaderCollection headers)
422 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
425 internal void SetWriteStreamError (WebExceptionStatus status, Exception exc)
427 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
430 internal byte[] GetRequestHeaders ()
432 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
435 internal void SetWriteStream (WebConnectionStream stream)
437 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
440 internal void SetResponseData (WebConnectionData data)
442 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
445 internal void SetResponseError (WebExceptionStatus status, Exception e, string where)
447 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
450 internal bool ReuseConnection {
451 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
452 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
455 internal WebConnection StoredConnection {
456 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
457 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }