HttpWebRequest.platformnotsupported.cs 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427
  1. //
  2. // System.Net.HttpWebRequest
  3. //
  4. // Author:
  5. // Rolf Bjarne Kvinge <[email protected]>
  6. //
  7. // Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
  8. //
  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:
  16. //
  17. // The above copyright notice and this permission notice shall be
  18. // included in all copies or substantial portions of the Software.
  19. //
  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.
  27. //
  28. using System.IO;
  29. using System.Net.Security;
  30. using System.Runtime.Serialization;
  31. using System.Security.Cryptography.X509Certificates;
  32. namespace System.Net
  33. {
  34. [Serializable]
  35. public class HttpWebRequest : WebRequest, ISerializable
  36. {
  37. internal const string EXCEPTION_MESSAGE = "System.Net.HttpWebRequest is not supported on the current platform.";
  38. #if MOBILE
  39. public
  40. #else
  41. internal
  42. #endif
  43. HttpWebRequest (Uri uri)
  44. {
  45. throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  46. }
  47. internal HttpWebRequest (Uri uri, object /* IMonoTlsProvider */ tlsProvider, object /* MonoTlsSettings */ settings = null)
  48. {
  49. throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  50. }
  51. protected HttpWebRequest (SerializationInfo serializationInfo, StreamingContext streamingContext)
  52. {
  53. throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  54. }
  55. public string Accept {
  56. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  57. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  58. }
  59. public Uri Address {
  60. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  61. }
  62. public virtual bool AllowAutoRedirect {
  63. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  64. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  65. }
  66. public virtual bool AllowWriteStreamBuffering {
  67. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  68. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  69. }
  70. public virtual bool AllowReadStreamBuffering {
  71. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  72. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  73. }
  74. public DecompressionMethods AutomaticDecompression {
  75. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  76. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  77. }
  78. internal bool InternalAllowBuffering {
  79. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  80. }
  81. public X509CertificateCollection ClientCertificates {
  82. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  83. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  84. }
  85. public string Connection {
  86. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  87. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  88. }
  89. public override string ConnectionGroupName {
  90. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  91. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  92. }
  93. public override long ContentLength {
  94. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  95. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  96. }
  97. internal long InternalContentLength {
  98. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  99. }
  100. public override string ContentType {
  101. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  102. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  103. }
  104. public HttpContinueDelegate ContinueDelegate {
  105. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  106. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  107. }
  108. public virtual CookieContainer CookieContainer {
  109. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  110. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  111. }
  112. public override ICredentials Credentials {
  113. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  114. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  115. }
  116. public DateTime Date {
  117. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  118. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  119. }
  120. #if !MOBILE
  121. public static new RequestCachePolicy DefaultCachePolicy {
  122. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  123. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  124. }
  125. #endif
  126. public static int DefaultMaximumErrorResponseLength {
  127. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  128. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  129. }
  130. public string Expect {
  131. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  132. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  133. }
  134. public virtual bool HaveResponse {
  135. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  136. }
  137. public override WebHeaderCollection Headers {
  138. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  139. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  140. }
  141. public string Host {
  142. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  143. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  144. }
  145. public DateTime IfModifiedSince {
  146. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  147. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  148. }
  149. public bool KeepAlive {
  150. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  151. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  152. }
  153. public int MaximumAutomaticRedirections {
  154. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  155. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  156. }
  157. public int MaximumResponseHeadersLength {
  158. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  159. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  160. }
  161. public static int DefaultMaximumResponseHeadersLength {
  162. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  163. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  164. }
  165. public int ReadWriteTimeout {
  166. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  167. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  168. }
  169. public int ContinueTimeout {
  170. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  171. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  172. }
  173. public string MediaType {
  174. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  175. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  176. }
  177. public override string Method {
  178. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  179. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  180. }
  181. public bool Pipelined {
  182. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  183. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  184. }
  185. public override bool PreAuthenticate {
  186. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  187. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  188. }
  189. public Version ProtocolVersion {
  190. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  191. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  192. }
  193. public override IWebProxy Proxy {
  194. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  195. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  196. }
  197. public string Referer {
  198. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  199. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  200. }
  201. public override Uri RequestUri {
  202. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  203. }
  204. public bool SendChunked {
  205. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  206. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  207. }
  208. public ServicePoint ServicePoint {
  209. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  210. }
  211. internal ServicePoint ServicePointNoLock {
  212. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  213. }
  214. public virtual bool SupportsCookieContainer {
  215. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  216. }
  217. public override int Timeout {
  218. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  219. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  220. }
  221. public string TransferEncoding {
  222. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  223. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  224. }
  225. public override bool UseDefaultCredentials {
  226. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  227. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  228. }
  229. public string UserAgent {
  230. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  231. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  232. }
  233. public bool UnsafeAuthenticatedConnectionSharing {
  234. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  235. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  236. }
  237. internal bool ExpectContinue {
  238. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  239. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  240. }
  241. internal ServerCertValidationCallback ServerCertValidationCallback {
  242. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  243. }
  244. internal Uri AuthUri {
  245. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  246. }
  247. public RemoteCertificateValidationCallback ServerCertificateValidationCallback {
  248. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  249. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  250. }
  251. public void AddRange (int range)
  252. {
  253. throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  254. }
  255. public void AddRange (int from, int to)
  256. {
  257. throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  258. }
  259. public void AddRange (string rangeSpecifier, int range)
  260. {
  261. throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  262. }
  263. public void AddRange (string rangeSpecifier, int from, int to)
  264. {
  265. throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  266. }
  267. public void AddRange (long range)
  268. {
  269. throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  270. }
  271. public void AddRange (long from, long to)
  272. {
  273. throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  274. }
  275. public void AddRange (string rangeSpecifier, long range)
  276. {
  277. throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  278. }
  279. public void AddRange (string rangeSpecifier, long from, long to)
  280. {
  281. throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  282. }
  283. public override IAsyncResult BeginGetRequestStream (AsyncCallback callback, object state)
  284. {
  285. throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  286. }
  287. public override Stream EndGetRequestStream (IAsyncResult asyncResult)
  288. {
  289. throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  290. }
  291. public override Stream GetRequestStream()
  292. {
  293. throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  294. }
  295. public System.IO.Stream GetRequestStream (out TransportContext context)
  296. {
  297. throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  298. }
  299. public override IAsyncResult BeginGetResponse (AsyncCallback callback, object state)
  300. {
  301. throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  302. }
  303. public override WebResponse EndGetResponse (IAsyncResult asyncResult)
  304. {
  305. throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  306. }
  307. public Stream EndGetRequestStream (IAsyncResult asyncResult, out TransportContext transportContext)
  308. {
  309. throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  310. }
  311. public override WebResponse GetResponse()
  312. {
  313. throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  314. }
  315. internal bool FinishedReading {
  316. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  317. set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  318. }
  319. internal bool Aborted {
  320. get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
  321. }
  322. public override void Abort ()
  323. {
  324. throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  325. }
  326. void ISerializable.GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)
  327. {
  328. throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  329. }
  330. protected override void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)
  331. {
  332. throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  333. }
  334. internal void DoContinueDelegate (int statusCode, WebHeaderCollection headers)
  335. {
  336. throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  337. }
  338. internal void SetWriteStreamError (WebExceptionStatus status, Exception exc)
  339. {
  340. throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  341. }
  342. internal byte[] GetRequestHeaders ()
  343. {
  344. throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
  345. }
  346. }
  347. }