upgrade
This commit is contained in:
@@ -427,15 +427,15 @@ namespace Coolape
|
||||
}
|
||||
}
|
||||
|
||||
public static UnityWebRequest put(string url, string data, CLAssetType type,
|
||||
public static UnityWebRequest put(string url, object header, string data, CLAssetType type,
|
||||
object successCallback,
|
||||
object failedCallback, object orgs,
|
||||
bool isCheckTimeout = true, int maxFailTimes = 1)
|
||||
{
|
||||
return _put(url, data, type, successCallback, failedCallback, orgs, isCheckTimeout, maxFailTimes, 0);
|
||||
return _put(url, header, data, type, successCallback, failedCallback, orgs, isCheckTimeout, maxFailTimes, 0);
|
||||
}
|
||||
|
||||
private static UnityWebRequest _put(string url, string data, CLAssetType type,
|
||||
private static UnityWebRequest _put(string url, object header, string data, CLAssetType type,
|
||||
object successCallback,
|
||||
object failedCallback, object orgs, bool isCheckTimeout,
|
||||
int maxFailTimes, int failedTimes)
|
||||
@@ -447,11 +447,12 @@ namespace Coolape
|
||||
return null;
|
||||
self.enabled = true;
|
||||
UnityWebRequest www = UnityWebRequest.Put(url, data);
|
||||
setWWWHeader(www, header);
|
||||
Coroutine cor = self.StartCoroutine(
|
||||
self.exeWWW(www, url, type, successCallback, failedCallback, orgs, isCheckTimeout, maxFailTimes, failedTimes,
|
||||
(url2) =>
|
||||
{
|
||||
_put(url2, data, type, successCallback, failedCallback, orgs, isCheckTimeout, maxFailTimes, failedTimes + 1);
|
||||
_put(url2, header ,data, type, successCallback, failedCallback, orgs, isCheckTimeout, maxFailTimes, failedTimes + 1);
|
||||
}));
|
||||
wwwMap4Get[url] = cor;
|
||||
return www;
|
||||
@@ -464,16 +465,16 @@ namespace Coolape
|
||||
}
|
||||
}
|
||||
|
||||
public static UnityWebRequest put(string url, byte[] data, CLAssetType type,
|
||||
public static UnityWebRequest put(string url, object header, byte[] data, CLAssetType type,
|
||||
object successCallback,
|
||||
object failedCallback, object orgs, bool isCheckTimeout = true, int maxFailTimes = 1)
|
||||
{
|
||||
return _put(url, data, type,
|
||||
return _put(url, header, data, type,
|
||||
successCallback,
|
||||
failedCallback, orgs, isCheckTimeout,
|
||||
maxFailTimes, 0);
|
||||
}
|
||||
private static UnityWebRequest _put(string url, byte[] data, CLAssetType type,
|
||||
private static UnityWebRequest _put(string url, object header, byte[] data, CLAssetType type,
|
||||
object successCallback,
|
||||
object failedCallback, object orgs, bool isCheckTimeout,
|
||||
int maxFailTimes, int failedTimes)
|
||||
@@ -484,11 +485,12 @@ namespace Coolape
|
||||
return null;
|
||||
self.enabled = true;
|
||||
UnityWebRequest www = UnityWebRequest.Put(url, data);
|
||||
setWWWHeader(www, header);
|
||||
Coroutine cor = self.StartCoroutine(
|
||||
self.exeWWW(www, url, type, successCallback, failedCallback, orgs, isCheckTimeout, maxFailTimes, failedTimes,
|
||||
(url2) =>
|
||||
{
|
||||
_put(url2, data, type, successCallback, failedCallback, orgs, isCheckTimeout, maxFailTimes, failedTimes + 1);
|
||||
_put(url2, header, data, type, successCallback, failedCallback, orgs, isCheckTimeout, maxFailTimes, failedTimes + 1);
|
||||
}));
|
||||
wwwMap4Get[url] = cor;
|
||||
return www;
|
||||
@@ -517,11 +519,18 @@ namespace Coolape
|
||||
public static UnityWebRequest uploadFile(string url, string sectionName, string fileName, byte[] fileContent, CLAssetType type,
|
||||
object successCallback, object failedCallback, object orgs, bool isCheckTimeout = true, int maxFailTimes = 1)
|
||||
{
|
||||
return _uploadFile(url, sectionName, fileName, fileContent, type,
|
||||
return _uploadFile(url, null, sectionName, fileName, fileContent, type,
|
||||
successCallback, failedCallback, orgs, isCheckTimeout,
|
||||
maxFailTimes, 0);
|
||||
}
|
||||
private static UnityWebRequest _uploadFile(string url, string sectionName, string fileName, byte[] fileContent, CLAssetType type,
|
||||
public static UnityWebRequest uploadFile(string url, object header, string sectionName, string fileName, byte[] fileContent, CLAssetType type,
|
||||
object successCallback, object failedCallback, object orgs, bool isCheckTimeout = true, int maxFailTimes = 1)
|
||||
{
|
||||
return _uploadFile(url,header, sectionName, fileName, fileContent, type,
|
||||
successCallback, failedCallback, orgs, isCheckTimeout,
|
||||
maxFailTimes, 0);
|
||||
}
|
||||
private static UnityWebRequest _uploadFile(string url, object header, string sectionName, string fileName, byte[] fileContent, CLAssetType type,
|
||||
object successCallback, object failedCallback, object orgs, bool isCheckTimeout,
|
||||
int maxFailTimes, int failedTimes)
|
||||
{
|
||||
@@ -534,11 +543,12 @@ namespace Coolape
|
||||
List<IMultipartFormSection> multForom = new List<IMultipartFormSection>();
|
||||
multForom.Add(fileSection);
|
||||
UnityWebRequest www = UnityWebRequest.Post(url, multForom);
|
||||
setWWWHeader(www, header);
|
||||
Coroutine cor = self.StartCoroutine(
|
||||
self.exeWWW(www, url, type, successCallback, failedCallback, orgs, isCheckTimeout, maxFailTimes, failedTimes,
|
||||
(url2) =>
|
||||
{
|
||||
_uploadFile(url2, sectionName, fileName, fileContent, type, successCallback, failedCallback, orgs, isCheckTimeout, maxFailTimes, failedTimes + 1);
|
||||
_uploadFile(url2, header, sectionName, fileName, fileContent, type, successCallback, failedCallback, orgs, isCheckTimeout, maxFailTimes, failedTimes + 1);
|
||||
}));
|
||||
wwwMap4Get[url] = cor;
|
||||
return www;
|
||||
|
||||
Reference in New Issue
Block a user