forked from MattRix/UnityDecompiled
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUnityWebRequest.cs
More file actions
850 lines (772 loc) · 22.3 KB
/
Copy pathUnityWebRequest.cs
File metadata and controls
850 lines (772 loc) · 22.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using UnityEngine.Scripting;
using UnityEngineInternal;
namespace UnityEngine.Networking
{
[StructLayout(LayoutKind.Sequential)]
public sealed class UnityWebRequest : IDisposable
{
internal enum UnityWebRequestMethod
{
Get,
Post,
Put,
Head,
Custom
}
internal enum UnityWebRequestError
{
OK,
Unknown,
SDKError,
UnsupportedProtocol,
MalformattedUrl,
CannotResolveProxy,
CannotResolveHost,
CannotConnectToHost,
AccessDenied,
GenericHTTPError,
WriteError,
ReadError,
OutOfMemory,
Timeout,
HTTPPostError,
SSLCannotConnect,
Aborted,
TooManyRedirects,
ReceivedNoData,
SSLNotSupported,
FailedToSendData,
FailedToReceiveData,
SSLCertificateError,
SSLCipherNotAvailable,
SSLCACertError,
UnrecognizedContentEncoding,
LoginFailed,
SSLShutdownFailed,
NoInternetConnection
}
[NonSerialized]
internal IntPtr m_Ptr;
public const string kHttpVerbGET = "GET";
public const string kHttpVerbHEAD = "HEAD";
public const string kHttpVerbPOST = "POST";
public const string kHttpVerbPUT = "PUT";
public const string kHttpVerbCREATE = "CREATE";
public const string kHttpVerbDELETE = "DELETE";
private static readonly string[] forbiddenHeaderKeys = new string[]
{
"accept-charset",
"access-control-request-headers",
"access-control-request-method",
"connection",
"content-length",
"date",
"dnt",
"expect",
"host",
"keep-alive",
"origin",
"referer",
"te",
"trailer",
"transfer-encoding",
"upgrade",
"user-agent",
"via",
"x-unity-version"
};
public bool disposeDownloadHandlerOnDispose
{
get;
set;
}
public bool disposeUploadHandlerOnDispose
{
get;
set;
}
public string method
{
get
{
string result;
switch (this.InternalGetMethod())
{
case 0:
result = "GET";
break;
case 1:
result = "POST";
break;
case 2:
result = "PUT";
break;
case 3:
result = "HEAD";
break;
default:
result = this.InternalGetCustomMethod();
break;
}
return result;
}
set
{
if (string.IsNullOrEmpty(value))
{
throw new ArgumentException("Cannot set a UnityWebRequest's method to an empty or null string");
}
string text = value.ToUpper();
if (text != null)
{
if (text == "GET")
{
this.InternalSetMethod(UnityWebRequest.UnityWebRequestMethod.Get);
return;
}
if (text == "POST")
{
this.InternalSetMethod(UnityWebRequest.UnityWebRequestMethod.Post);
return;
}
if (text == "PUT")
{
this.InternalSetMethod(UnityWebRequest.UnityWebRequestMethod.Put);
return;
}
if (text == "HEAD")
{
this.InternalSetMethod(UnityWebRequest.UnityWebRequestMethod.Head);
return;
}
}
this.InternalSetCustomMethod(value.ToUpper());
}
}
public extern string error
{
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
}
public extern bool useHttpContinue
{
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
set;
}
public string url
{
get
{
return this.InternalGetUrl();
}
set
{
string localUrl = "http://localhost/";
this.InternalSeturl(WebRequestUtils.MakeInitialUrl(value, localUrl));
}
}
public extern long responseCode
{
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
}
public extern float uploadProgress
{
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
}
public extern bool isModifiable
{
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
}
public extern bool isDone
{
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
}
public extern bool isError
{
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
}
public extern float downloadProgress
{
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
}
public extern ulong uploadedBytes
{
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
}
public extern ulong downloadedBytes
{
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
}
public extern int redirectLimit
{
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
set;
}
public extern bool chunkedTransfer
{
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
set;
}
public extern UploadHandler uploadHandler
{
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
set;
}
public extern DownloadHandler downloadHandler
{
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
set;
}
public UnityWebRequest()
{
this.InternalCreate();
this.InternalSetDefaults();
}
public UnityWebRequest(string url)
{
this.InternalCreate();
this.InternalSetDefaults();
this.url = url;
}
public UnityWebRequest(string url, string method)
{
this.InternalCreate();
this.InternalSetDefaults();
this.url = url;
this.method = method;
}
public UnityWebRequest(string url, string method, DownloadHandler downloadHandler, UploadHandler uploadHandler)
{
this.InternalCreate();
this.InternalSetDefaults();
this.url = url;
this.method = method;
this.downloadHandler = downloadHandler;
this.uploadHandler = uploadHandler;
}
public static UnityWebRequest Get(string uri)
{
return new UnityWebRequest(uri, "GET", new DownloadHandlerBuffer(), null);
}
public static UnityWebRequest Delete(string uri)
{
return new UnityWebRequest(uri, "DELETE");
}
public static UnityWebRequest Head(string uri)
{
return new UnityWebRequest(uri, "HEAD");
}
public static UnityWebRequest GetTexture(string uri)
{
return UnityWebRequest.GetTexture(uri, false);
}
public static UnityWebRequest GetTexture(string uri, bool nonReadable)
{
return new UnityWebRequest(uri, "GET", new DownloadHandlerTexture(nonReadable), null);
}
public static UnityWebRequest GetAudioClip(string uri, AudioType audioType)
{
Type type = Type.GetType("UnityEngine.Networking.DownloadHandlerAudioClip");
UnityWebRequest result;
if (type == null)
{
result = UnityWebRequest.Get(uri);
}
else
{
ConstructorInfo constructor = type.GetConstructor(new Type[]
{
typeof(string),
typeof(AudioType)
});
UnityWebRequest unityWebRequest = new UnityWebRequest(uri, "GET", constructor.Invoke(new object[]
{
uri,
audioType
}) as DownloadHandler, null);
result = unityWebRequest;
}
return result;
}
public static UnityWebRequest GetAssetBundle(string uri)
{
return UnityWebRequest.GetAssetBundle(uri, 0u);
}
public static UnityWebRequest GetAssetBundle(string uri, uint crc)
{
return new UnityWebRequest(uri, "GET", new DownloadHandlerAssetBundle(uri, crc), null);
}
public static UnityWebRequest GetAssetBundle(string uri, uint version, uint crc)
{
return new UnityWebRequest(uri, "GET", new DownloadHandlerAssetBundle(uri, version, crc), null);
}
public static UnityWebRequest GetAssetBundle(string uri, Hash128 hash, uint crc)
{
return new UnityWebRequest(uri, "GET", new DownloadHandlerAssetBundle(uri, hash, crc), null);
}
public static UnityWebRequest Put(string uri, byte[] bodyData)
{
return new UnityWebRequest(uri, "PUT", new DownloadHandlerBuffer(), new UploadHandlerRaw(bodyData));
}
public static UnityWebRequest Put(string uri, string bodyData)
{
return new UnityWebRequest(uri, "PUT", new DownloadHandlerBuffer(), new UploadHandlerRaw(Encoding.UTF8.GetBytes(bodyData)));
}
public static UnityWebRequest Post(string uri, string postData)
{
UnityWebRequest unityWebRequest = new UnityWebRequest(uri, "POST");
byte[] data = null;
if (!string.IsNullOrEmpty(postData))
{
string s = WWWTranscoder.URLEncode(postData, Encoding.UTF8);
data = Encoding.UTF8.GetBytes(s);
}
unityWebRequest.uploadHandler = new UploadHandlerRaw(data);
unityWebRequest.uploadHandler.contentType = "application/x-www-form-urlencoded";
unityWebRequest.downloadHandler = new DownloadHandlerBuffer();
return unityWebRequest;
}
public static UnityWebRequest Post(string uri, WWWForm formData)
{
UnityWebRequest unityWebRequest = new UnityWebRequest(uri, "POST");
byte[] array = null;
if (formData != null)
{
array = formData.data;
if (array.Length == 0)
{
array = null;
}
}
unityWebRequest.uploadHandler = new UploadHandlerRaw(array);
unityWebRequest.downloadHandler = new DownloadHandlerBuffer();
if (formData != null)
{
Dictionary<string, string> headers = formData.headers;
foreach (KeyValuePair<string, string> current in headers)
{
unityWebRequest.SetRequestHeader(current.Key, current.Value);
}
}
return unityWebRequest;
}
public static UnityWebRequest Post(string uri, List<IMultipartFormSection> multipartFormSections)
{
byte[] boundary = UnityWebRequest.GenerateBoundary();
return UnityWebRequest.Post(uri, multipartFormSections, boundary);
}
public static UnityWebRequest Post(string uri, List<IMultipartFormSection> multipartFormSections, byte[] boundary)
{
UnityWebRequest unityWebRequest = new UnityWebRequest(uri, "POST");
byte[] data = null;
if (multipartFormSections != null && multipartFormSections.Count != 0)
{
data = UnityWebRequest.SerializeFormSections(multipartFormSections, boundary);
}
unityWebRequest.uploadHandler = new UploadHandlerRaw(data)
{
contentType = "multipart/form-data; boundary=" + Encoding.UTF8.GetString(boundary, 0, boundary.Length)
};
unityWebRequest.downloadHandler = new DownloadHandlerBuffer();
return unityWebRequest;
}
public static UnityWebRequest Post(string uri, Dictionary<string, string> formFields)
{
UnityWebRequest unityWebRequest = new UnityWebRequest(uri, "POST");
byte[] data = null;
if (formFields != null && formFields.Count != 0)
{
data = UnityWebRequest.SerializeSimpleForm(formFields);
}
unityWebRequest.uploadHandler = new UploadHandlerRaw(data)
{
contentType = "application/x-www-form-urlencoded"
};
unityWebRequest.downloadHandler = new DownloadHandlerBuffer();
return unityWebRequest;
}
public static byte[] SerializeFormSections(List<IMultipartFormSection> multipartFormSections, byte[] boundary)
{
byte[] bytes = Encoding.UTF8.GetBytes("\r\n");
int num = 0;
foreach (IMultipartFormSection current in multipartFormSections)
{
num += 64 + current.sectionData.Length;
}
List<byte> list = new List<byte>(num);
foreach (IMultipartFormSection current2 in multipartFormSections)
{
string str = "form-data";
string sectionName = current2.sectionName;
string fileName = current2.fileName;
if (!string.IsNullOrEmpty(fileName))
{
str = "file";
}
string text = "Content-Disposition: " + str;
if (!string.IsNullOrEmpty(sectionName))
{
text = text + "; name=\"" + sectionName + "\"";
}
if (!string.IsNullOrEmpty(fileName))
{
text = text + "; filename=\"" + fileName + "\"";
}
text += "\r\n";
string contentType = current2.contentType;
if (!string.IsNullOrEmpty(contentType))
{
text = text + "Content-Type: " + contentType + "\r\n";
}
list.AddRange(boundary);
list.AddRange(bytes);
list.AddRange(Encoding.UTF8.GetBytes(text));
list.AddRange(bytes);
list.AddRange(current2.sectionData);
}
list.TrimExcess();
return list.ToArray();
}
public static byte[] GenerateBoundary()
{
byte[] array = new byte[40];
for (int i = 0; i < 40; i++)
{
int num = UnityEngine.Random.Range(48, 110);
if (num > 57)
{
num += 7;
}
if (num > 90)
{
num += 6;
}
array[i] = (byte)num;
}
return array;
}
public static byte[] SerializeSimpleForm(Dictionary<string, string> formFields)
{
string text = "";
foreach (KeyValuePair<string, string> current in formFields)
{
if (text.Length > 0)
{
text += "&";
}
text = text + Uri.EscapeDataString(current.Key) + "=" + Uri.EscapeDataString(current.Value);
}
return Encoding.UTF8.GetBytes(text);
}
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
internal extern void InternalCreate();
[GeneratedByOldBindingsGenerator, ThreadAndSerializationSafe]
[MethodImpl(MethodImplOptions.InternalCall)]
internal extern void InternalDestroy();
private void InternalSetDefaults()
{
this.disposeDownloadHandlerOnDispose = true;
this.disposeUploadHandlerOnDispose = true;
}
~UnityWebRequest()
{
this.InternalDestroy();
}
public void Dispose()
{
if (this.disposeDownloadHandlerOnDispose)
{
DownloadHandler downloadHandler = this.downloadHandler;
if (downloadHandler != null)
{
downloadHandler.Dispose();
}
}
if (this.disposeUploadHandlerOnDispose)
{
UploadHandler uploadHandler = this.uploadHandler;
if (uploadHandler != null)
{
uploadHandler.Dispose();
}
}
this.InternalDestroy();
GC.SuppressFinalize(this);
}
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
internal extern AsyncOperation InternalBegin();
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
internal extern void InternalAbort();
public AsyncOperation Send()
{
return this.InternalBegin();
}
public void Abort()
{
this.InternalAbort();
}
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
internal extern void InternalSetMethod(UnityWebRequest.UnityWebRequestMethod methodType);
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
internal extern void InternalSetCustomMethod(string customMethodName);
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
internal extern int InternalGetMethod();
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
internal extern string InternalGetCustomMethod();
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
internal extern int InternalGetError();
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
private extern string InternalGetUrl();
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
private extern void InternalSeturl(string url);
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
public extern string GetRequestHeader(string name);
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
internal extern void InternalSetRequestHeader(string name, string value);
public void SetRequestHeader(string name, string value)
{
if (string.IsNullOrEmpty(name))
{
throw new ArgumentException("Cannot set a Request Header with a null or empty name");
}
if (value == null)
{
throw new ArgumentException("Cannot set a Request header with a null");
}
if (!UnityWebRequest.IsHeaderNameLegal(name))
{
throw new ArgumentException("Cannot set Request Header " + name + " - name contains illegal characters or is not user-overridable");
}
if (!UnityWebRequest.IsHeaderValueLegal(value))
{
throw new ArgumentException("Cannot set Request Header - value contains illegal characters");
}
this.InternalSetRequestHeader(name, value);
}
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
public extern string GetResponseHeader(string name);
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
internal extern string[] InternalGetResponseHeaderKeys();
public Dictionary<string, string> GetResponseHeaders()
{
string[] array = this.InternalGetResponseHeaderKeys();
Dictionary<string, string> result;
if (array == null)
{
result = null;
}
else
{
Dictionary<string, string> dictionary = new Dictionary<string, string>(array.Length, StringComparer.OrdinalIgnoreCase);
for (int i = 0; i < array.Length; i++)
{
string responseHeader = this.GetResponseHeader(array[i]);
dictionary.Add(array[i], responseHeader);
}
result = dictionary;
}
return result;
}
private static bool ContainsForbiddenCharacters(string s, int firstAllowedCharCode)
{
bool result;
for (int i = 0; i < s.Length; i++)
{
char c = s[i];
if ((int)c < firstAllowedCharCode || c == '\u007f')
{
result = true;
return result;
}
}
result = false;
return result;
}
private static bool IsHeaderNameLegal(string headerName)
{
bool result;
if (string.IsNullOrEmpty(headerName))
{
result = false;
}
else
{
headerName = headerName.ToLower();
if (UnityWebRequest.ContainsForbiddenCharacters(headerName, 33))
{
result = false;
}
else if (headerName.StartsWith("sec-") || headerName.StartsWith("proxy-"))
{
result = false;
}
else
{
string[] array = UnityWebRequest.forbiddenHeaderKeys;
for (int i = 0; i < array.Length; i++)
{
string b = array[i];
if (string.Equals(headerName, b))
{
result = false;
return result;
}
}
result = true;
}
}
return result;
}
private static bool IsHeaderValueLegal(string headerValue)
{
return !UnityWebRequest.ContainsForbiddenCharacters(headerValue, 32);
}
private static string GetErrorDescription(UnityWebRequest.UnityWebRequestError errorCode)
{
string result;
switch (errorCode)
{
case UnityWebRequest.UnityWebRequestError.OK:
result = "No Error";
return result;
case UnityWebRequest.UnityWebRequestError.SDKError:
result = "Internal Error With Transport Layer";
return result;
case UnityWebRequest.UnityWebRequestError.UnsupportedProtocol:
result = "Specified Transport Protocol is Unsupported";
return result;
case UnityWebRequest.UnityWebRequestError.MalformattedUrl:
result = "URL is Malformatted";
return result;
case UnityWebRequest.UnityWebRequestError.CannotResolveProxy:
result = "Unable to resolve specified proxy server";
return result;
case UnityWebRequest.UnityWebRequestError.CannotResolveHost:
result = "Unable to resolve host specified in URL";
return result;
case UnityWebRequest.UnityWebRequestError.CannotConnectToHost:
result = "Unable to connect to host specified in URL";
return result;
case UnityWebRequest.UnityWebRequestError.AccessDenied:
result = "Remote server denied access to the specified URL";
return result;
case UnityWebRequest.UnityWebRequestError.GenericHTTPError:
result = "Unknown/Generic HTTP Error - Check HTTP Error code";
return result;
case UnityWebRequest.UnityWebRequestError.WriteError:
result = "Error when transmitting request to remote server - transmission terminated prematurely";
return result;
case UnityWebRequest.UnityWebRequestError.ReadError:
result = "Error when reading response from remote server - transmission terminated prematurely";
return result;
case UnityWebRequest.UnityWebRequestError.OutOfMemory:
result = "Out of Memory";
return result;
case UnityWebRequest.UnityWebRequestError.Timeout:
result = "Timeout occurred while waiting for response from remote server";
return result;
case UnityWebRequest.UnityWebRequestError.HTTPPostError:
result = "Error while transmitting HTTP POST body data";
return result;
case UnityWebRequest.UnityWebRequestError.SSLCannotConnect:
result = "Unable to connect to SSL server at remote host";
return result;
case UnityWebRequest.UnityWebRequestError.Aborted:
result = "Request was manually aborted by local code";
return result;
case UnityWebRequest.UnityWebRequestError.TooManyRedirects:
result = "Redirect limit exceeded";
return result;
case UnityWebRequest.UnityWebRequestError.ReceivedNoData:
result = "Received an empty response from remote host";
return result;
case UnityWebRequest.UnityWebRequestError.SSLNotSupported:
result = "SSL connections are not supported on the local machine";
return result;
case UnityWebRequest.UnityWebRequestError.FailedToSendData:
result = "Failed to transmit body data";
return result;
case UnityWebRequest.UnityWebRequestError.FailedToReceiveData:
result = "Failed to receive response body data";
return result;
case UnityWebRequest.UnityWebRequestError.SSLCertificateError:
result = "Failure to authenticate SSL certificate of remote host";
return result;
case UnityWebRequest.UnityWebRequestError.SSLCipherNotAvailable:
result = "SSL cipher received from remote host is not supported on the local machine";
return result;
case UnityWebRequest.UnityWebRequestError.SSLCACertError:
result = "Failure to authenticate Certificate Authority of the SSL certificate received from the remote host";
return result;
case UnityWebRequest.UnityWebRequestError.UnrecognizedContentEncoding:
result = "Remote host returned data with an unrecognized/unparseable content encoding";
return result;
case UnityWebRequest.UnityWebRequestError.LoginFailed:
result = "HTTP authentication failed";
return result;
case UnityWebRequest.UnityWebRequestError.SSLShutdownFailed:
result = "Failure while shutting down SSL connection";
return result;
}
result = "Unknown error";
return result;
}
}
}