scripts
This commit is contained in:
@@ -0,0 +1,135 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace UnityEngine.Networking
|
||||
{
|
||||
// Token: 0x0200028E RID: 654
|
||||
public class MultipartFormFileSection : IMultipartFormSection
|
||||
{
|
||||
// Token: 0x06002CE3 RID: 11491 RVA: 0x0003ECFC File Offset: 0x0003CEFC
|
||||
public MultipartFormFileSection(string name, byte[] data, string fileName, string contentType)
|
||||
{
|
||||
if (data == null || data.Length < 1)
|
||||
{
|
||||
throw new ArgumentException("Cannot create a multipart form file section without body data");
|
||||
}
|
||||
if (string.IsNullOrEmpty(fileName))
|
||||
{
|
||||
fileName = "file.dat";
|
||||
}
|
||||
if (string.IsNullOrEmpty(contentType))
|
||||
{
|
||||
contentType = "application/octet-stream";
|
||||
}
|
||||
this.Init(name, data, fileName, contentType);
|
||||
}
|
||||
|
||||
// Token: 0x06002CE4 RID: 11492 RVA: 0x0003ED60 File Offset: 0x0003CF60
|
||||
public MultipartFormFileSection(byte[] data)
|
||||
: this(null, data, null, null)
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x06002CE5 RID: 11493 RVA: 0x0003ED70 File Offset: 0x0003CF70
|
||||
public MultipartFormFileSection(string fileName, byte[] data)
|
||||
: this(null, data, fileName, null)
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x06002CE6 RID: 11494 RVA: 0x0003ED80 File Offset: 0x0003CF80
|
||||
public MultipartFormFileSection(string name, string data, Encoding dataEncoding, string fileName)
|
||||
{
|
||||
if (data == null || data.Length < 1)
|
||||
{
|
||||
throw new ArgumentException("Cannot create a multipart form file section without body data");
|
||||
}
|
||||
if (dataEncoding == null)
|
||||
{
|
||||
dataEncoding = Encoding.UTF8;
|
||||
}
|
||||
byte[] bytes = dataEncoding.GetBytes(data);
|
||||
if (string.IsNullOrEmpty(fileName))
|
||||
{
|
||||
fileName = "file.txt";
|
||||
}
|
||||
if (string.IsNullOrEmpty(this.content))
|
||||
{
|
||||
this.content = "text/plain; charset=" + dataEncoding.WebName;
|
||||
}
|
||||
this.Init(name, bytes, fileName, this.content);
|
||||
}
|
||||
|
||||
// Token: 0x06002CE7 RID: 11495 RVA: 0x0003EE18 File Offset: 0x0003D018
|
||||
public MultipartFormFileSection(string data, Encoding dataEncoding, string fileName)
|
||||
: this(null, data, dataEncoding, fileName)
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x06002CE8 RID: 11496 RVA: 0x0003EE28 File Offset: 0x0003D028
|
||||
public MultipartFormFileSection(string data, string fileName)
|
||||
: this(data, null, fileName)
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x06002CE9 RID: 11497 RVA: 0x0003EE34 File Offset: 0x0003D034
|
||||
private void Init(string name, byte[] data, string fileName, string contentType)
|
||||
{
|
||||
this.name = name;
|
||||
this.data = data;
|
||||
this.file = fileName;
|
||||
this.content = contentType;
|
||||
}
|
||||
|
||||
// Token: 0x17000A37 RID: 2615
|
||||
// (get) Token: 0x06002CEA RID: 11498 RVA: 0x0003EE54 File Offset: 0x0003D054
|
||||
public string sectionName
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000A38 RID: 2616
|
||||
// (get) Token: 0x06002CEB RID: 11499 RVA: 0x0003EE70 File Offset: 0x0003D070
|
||||
public byte[] sectionData
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.data;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000A39 RID: 2617
|
||||
// (get) Token: 0x06002CEC RID: 11500 RVA: 0x0003EE8C File Offset: 0x0003D08C
|
||||
public string fileName
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.file;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000A3A RID: 2618
|
||||
// (get) Token: 0x06002CED RID: 11501 RVA: 0x0003EEA8 File Offset: 0x0003D0A8
|
||||
public string contentType
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.content;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0400088F RID: 2191
|
||||
private string name;
|
||||
|
||||
// Token: 0x04000890 RID: 2192
|
||||
private byte[] data;
|
||||
|
||||
// Token: 0x04000891 RID: 2193
|
||||
private string file;
|
||||
|
||||
// Token: 0x04000892 RID: 2194
|
||||
private string content;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user