本文整理汇总了C#中UnityEngine.WWWForm类的典型用法代码示例。如果您正苦于以下问题:C# WWWForm类的具体用法?C# WWWForm怎么用?C# WWWForm使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WWWForm类属于UnityEngine命名空间,在下文中一共展示了WWWForm类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateWWWForm
public void UpdateWWWForm(ref WWWForm data)
{
if (fieldType == eFieldType.Verify)
return;
data.AddField(serverfield, value);
}
示例2: SendCoroutine
public IEnumerator SendCoroutine()
{
AddDefaultParameters();
WWWForm requestForm = new WWWForm ();
requestForm.AddField ("name", this.eventName);
requestForm.AddField ("data", this.data.ToString ());
if (!this.customData.IsNull) {
requestForm.AddField ("customData", this.customData.Print(false));
} else {
requestForm.AddField ("customData", "{}");
}
requestForm.AddField ("ts", "1470057439857");
requestForm.AddField ("queued", 0);
requestForm.AddField ("debugMode", "true");
WWW request = new WWW ("https://apptracker.spilgames.com/v1/native-events/event/android/" + Spil.BundleIdEditor + "/" + this.eventName, requestForm);
yield return request;
// while (!request.isDone);
if (request.error != null) {
Debug.LogError ("Error getting data: " + request.error);
Debug.LogError ("Error getting data: " + request.text);
} else {
JSONObject serverResponse = new JSONObject (request.text);
Debug.Log ("Data returned: " + serverResponse.ToString());
ResponseEvent.Build(serverResponse);
}
}
示例3: GetNewTrades
IEnumerator GetNewTrades()
{
WWWForm form = new WWWForm();
form.AddField("_Token", APIKey); //The token
form.AddField("Symbols", symbols); //The Symbols you want
DateTimeOffset currentTimeEST = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, easternZone);
form.AddField("StartDateTime", lastUpdatedEST.ToString(timeFormat)); //The proper DateTime in the proper format
form.AddField("EndDateTime", currentTimeEST.AddTicks(-1000000).ToString(timeFormat)); //The proper DateTime in the proper format
var url = "http://ws.nasdaqdod.com/v1/NASDAQTrades.asmx/GetTrades HTTP/1.1";
WWW www = new WWW(url, form);
yield return www;
if (www.error == null)
{
//Sucessfully loaded the JSON string
Debug.Log("Loaded following JSON string" + www.text);
}
else
{
Debug.Log("ERROR: " + www.error);
}
}
示例4: GET
public WWW GET(string url,WWWForm _form,Action<WWW> action)
{
CancelFlag = false;
WWW www = new WWW(url,_form);
EditorCoroutine.start(ProcessRequest(www,action));
return www;
}
示例5: Balance
/**
* Authenticated resource which returns the current balance of the developer in Bitcoins
*/
public void Balance(string email, string pass, Action<JSONObject> success, Action<string> error)
{
WWWForm form = new WWWForm();
form.AddField("email", email);
form.AddField("pass", Util.Encrypt(pass));
t.Get("developer/balance", form, success, error);
}
示例6: Register
/**
* Creates a new player account
*/
public void Register(string name, string pass, Action<JSONObject> success, Action<string> error)
{
WWWForm form = new WWWForm();
form.AddField("name", name);
form.AddField("pass", Util.Encrypt(pass));
t.Post("player/register", form, success, error);
}
示例7: Post
public void Post(string url, Action<JSONObject> success, Action<string> error)
{
WWWForm form = new WWWForm();
WWW www = new WWW(api + url, form);
StartCoroutine(WaitForRequest(www, success, error));
}
示例8: Authenticate
public IEnumerator Authenticate(string gameId, string hostname, int httpPort, string username, string password, Success success, Error error)
{
string prefix;
if (NetworkSettings.instance.httpUseSSL) {
prefix = "https://";
} else {
prefix = "http://";
}
string uri = prefix + hostname + ":" + httpPort + "/api/client/login/" + gameId;
//Debug.Log ("Authenticating via " + uri);
var form = new WWWForm ();
form.AddField ("username", username);
form.AddField ("password", password);
WWW www = new WWW (uri, form.data, form.headers);
yield return www;
if (www.error != null) {
Debug.Log(www.error);
error (www.error);
} else {
//Debug.Log(www.text);
Dictionary<string, string> values = JsonConvert.DeserializeObject<Dictionary<string, string>> (www.text);
success (values);
}
}
示例9: Balance
/**
* Authenticated resource which returns the current balance of the player in Bitcoins
*/
public void Balance(string name, string pass, Action<JSONObject> success, Action<string> error)
{
WWWForm form = new WWWForm();
form.AddField("name", name);
form.AddField("pass", Util.Encrypt(pass));
t.Get("player/balance", form, success, error);
}
示例10: sendBinaryData
// 如果想通过HTTP传递二进制流的话 可以使用 下面的方法。
public void sendBinaryData(string url, string str)
{
WWWForm wwwForm = new WWWForm();
byte[] byteStream = System.Text.Encoding.Default.GetBytes(str);
wwwForm.AddBinaryData("post", byteStream);
WWW www = new WWW(url, wwwForm);
}
示例11: HttpPostRequestProtected
public HttpPostRequestProtected(string host, string filePath, string user, string password, WWWForm wwwForm)
: base(host, filePath)
{
this.wwwForm = wwwForm;
this.user = user;
this.password = password;
}
示例12: AddParams
private WWWForm AddParams()
{
WWWForm form = new WWWForm();
form.AddField( GameConstants.REQUEST_KEY_API_KEY, Encryption.API_KEY);
form.AddField( GameConstants.REQUEST_KEY_TIMESTAMP, "" + (DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond));
return form;
}
示例13: Login
public void Login(string username, string password)
{
WWWForm form = new WWWForm();
form.AddField("username", username);
form.AddField("password", password);
httpService.HttpPost(LOGIN_URL, form, LoginCallback);
}
示例14: Request
public void Request(
Uri url,
HttpMethod method,
WWWForm query = null,
FacebookDelegate<IGraphResult> callback = null)
{
AsyncRequestString.Request(url, method, query, callback);
}
示例15: Queue
private void Queue(WWWForm data, int frame, float time)
{
Log log = new Log();
log.postData = data;
log.frame = frame;
log.time = time;
logs.AddLast(log);
}