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.";
46 HttpWebRequest (Uri uri)
48 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
51 internal HttpWebRequest (Uri uri, object /* IMonoTlsProvider */ tlsProvider, object /* MonoTlsSettings */ settings = null)
53 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
56 protected HttpWebRequest (SerializationInfo serializationInfo, StreamingContext streamingContext)
58 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
61 public string Accept {
62 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
63 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
67 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
70 public bool AllowAutoRedirect {
71 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
72 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
75 public bool AllowWriteStreamBuffering {
76 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
77 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
80 public virtual bool AllowReadStreamBuffering {
81 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
82 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
85 public DecompressionMethods AutomaticDecompression {
86 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
87 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
90 internal bool InternalAllowBuffering {
91 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
94 public X509CertificateCollection ClientCertificates {
95 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
96 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
99 public string Connection {
100 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
101 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
104 public override string ConnectionGroupName {
105 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
106 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
109 public override long ContentLength {
110 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
111 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
114 internal long InternalContentLength {
115 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
118 public override string ContentType {
119 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
120 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
123 public HttpContinueDelegate ContinueDelegate {
124 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
125 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
128 public virtual CookieContainer CookieContainer {
129 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
130 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
133 public override ICredentials Credentials {
134 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
135 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
138 public DateTime Date {
139 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
140 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
144 public static new RequestCachePolicy DefaultCachePolicy {
145 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
146 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
150 public static int DefaultMaximumErrorResponseLength {
151 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
152 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
155 public string Expect {
156 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
157 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
160 public virtual bool HaveResponse {
161 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
164 public override WebHeaderCollection Headers {
165 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
166 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
170 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
171 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
174 public DateTime IfModifiedSince {
175 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
176 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
179 public bool KeepAlive {
180 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
181 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
184 public int MaximumAutomaticRedirections {
185 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
186 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
189 public int MaximumResponseHeadersLength {
190 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
191 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
194 public static int DefaultMaximumResponseHeadersLength {
195 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
196 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
199 public int ReadWriteTimeout {
200 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
201 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
204 public int ContinueTimeout {
205 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
206 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
209 public string MediaType {
210 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
211 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
214 public override string Method {
215 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
216 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
219 public bool Pipelined {
220 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
221 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
224 public override bool PreAuthenticate {
225 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
226 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
229 public Version ProtocolVersion {
230 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
231 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
234 public override IWebProxy Proxy {
235 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
236 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
239 public string Referer {
240 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
241 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
244 public override Uri RequestUri {
245 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
248 public bool SendChunked {
249 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
250 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
253 public ServicePoint ServicePoint {
254 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
257 internal ServicePoint ServicePointNoLock {
258 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
261 public virtual bool SupportsCookieContainer {
262 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
265 public override int Timeout {
266 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
267 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
270 public string TransferEncoding {
271 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
272 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
275 public override bool UseDefaultCredentials {
276 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
277 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
280 public string UserAgent {
281 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
282 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
285 public bool UnsafeAuthenticatedConnectionSharing {
286 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
287 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
290 internal bool ExpectContinue {
291 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
292 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
295 internal ServerCertValidationCallback ServerCertValidationCallback {
296 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
299 internal Uri AuthUri {
300 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
303 public RemoteCertificateValidationCallback ServerCertificateValidationCallback {
304 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
305 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
308 public void AddRange (int range)
310 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
313 public void AddRange (int from, int to)
315 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
318 public void AddRange (string rangeSpecifier, int range)
320 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
323 public void AddRange (string rangeSpecifier, int from, int to)
325 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
328 public void AddRange (long range)
330 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
333 public void AddRange (long from, long to)
335 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
338 public void AddRange (string rangeSpecifier, long range)
340 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
343 public void AddRange (string rangeSpecifier, long from, long to)
345 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
348 public override IAsyncResult BeginGetRequestStream (AsyncCallback callback, object state)
350 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
353 public override Stream EndGetRequestStream (IAsyncResult asyncResult)
355 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
358 public override Stream GetRequestStream()
360 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
363 public override IAsyncResult BeginGetResponse (AsyncCallback callback, object state)
365 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
368 public override WebResponse EndGetResponse (IAsyncResult asyncResult)
370 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
373 public Stream EndGetRequestStream (IAsyncResult asyncResult, out TransportContext transportContext)
375 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
378 public override WebResponse GetResponse()
380 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
383 internal bool FinishedReading {
384 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
385 set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
388 internal bool Aborted {
389 get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
392 public override void Abort ()
394 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
397 void ISerializable.GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)
399 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
402 protected override void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)
404 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
407 internal void DoContinueDelegate (int statusCode, WebHeaderCollection headers)
409 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
412 internal void SetWriteStreamError (WebExceptionStatus status, Exception exc)
414 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
417 internal byte[] GetRequestHeaders ()
419 throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);