当前位置: 首页>>代码示例>>C#>>正文


C# API.Post方法代码示例

本文整理汇总了C#中API.Post方法的典型用法代码示例。如果您正苦于以下问题:C# API.Post方法的具体用法?C# API.Post怎么用?C# API.Post使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在API的用法示例。


在下文中一共展示了API.Post方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: sendAnswer

	void sendAnswer() {
		API request = new API();
		request.Post ("/game/" + PlayerPrefs.GetString ("gameId") + "/answer/" + PlayerPrefs.GetString ("questionId"), responseReady);
		request.AddField ("token", PlayerPrefs.GetString ("token"));
		request.AddField ("answer", answerText.text);
		request.AddField ("correct", correctAnswer.ToString());
		request.AddField ("position", answer.ToString());
		request.Send ();
	}
开发者ID:mengtest,项目名称:movieschallenge_client,代码行数:9,代码来源:AnswerScript.cs

示例2: createGameRandom

	public void createGameRandom () {
		// send analytics
		GameAnalytics.NewDesignEvent ("ui:game:random");
		// disable buttons
		_dispatcher.Dispatch ("disable_new_game_button");
		// call the API
		API request = new API ();
		request.Post ("/game/random", processResponse);
		request.AddField ("token", PlayerPrefs.GetString("token"));
		request.Send ();
	}
开发者ID:mengtest,项目名称:movieschallenge_client,代码行数:11,代码来源:CreateGame.cs

示例3: sendEndGame

	void sendEndGame(bool finished) {
		// send status of game to the server
		string uri = (finished) ? "/game/" + PlayerPrefs.GetString ("gameId") + "/finalRoundSuccess" : "/game/" + PlayerPrefs.GetString ("gameId") + "/finalRoundFailed";
		API request = new API();
		request.Post (uri, processGameEnd);
		request.AddField ("token", PlayerPrefs.GetString ("token"));
		request.Send ();
		// send analytics
		if (finished) {
			GameAnalytics.NewProgressionEvent(GA_Progression.GAProgressionStatus.GAProgressionStatusComplete, "match");
		}
	}
开发者ID:mengtest,项目名称:movieschallenge_client,代码行数:12,代码来源:FinalRoundLogicScript.cs

示例4: doAuthentication

	void doAuthentication(string username, string password) {
		GameAnalytics.NewDesignEvent ("ui:user:login");
		if (!string.IsNullOrEmpty (username)
		    && !string.IsNullOrEmpty (password)) {
			API req = new API ();
			req.Post ("/authenticate", onAuthenticationFinished);
			req.AddField ("username", username);
			req.AddField ("password", password);
			req.interstitialLoading = true;
			req.Send ();
		}
	}
开发者ID:mengtest,项目名称:movieschallenge_client,代码行数:12,代码来源:Authenticate.cs

示例5: createUser

	public void createUser(string username, string password, string email) {
		GameAnalytics.NewDesignEvent ("ui:user:login");
		if (!string.IsNullOrEmpty (username)
			&& !string.IsNullOrEmpty (password)
			&& !string.IsNullOrEmpty (email)) {
			API req = new API ();
			req.Post ("/user", onAuthenticationFinished);
			req.AddField ("username", username);
			req.AddField ("password", password);
			req.AddField ("email", email);
			req.interstitialLoading = true;
			req.Send ();
		}
	}
开发者ID:mengtest,项目名称:movieschallenge_client,代码行数:14,代码来源:Authenticate.cs

示例6: createGame

	// create a new game
	public void createGame(string opponentUsername) {
		if (!string.IsNullOrEmpty (opponentUsername)) {
			// disable buttons
			_dispatcher.Dispatch ("disable_new_game_button");
			// create the game
			string challenger = PlayerPrefs.GetString("username");
			string challenged = opponentUsername;
			// call the API
			API request = new API ();
			request.Post ("/game", processResponse);
			request.AddField ("challenger", challenger);
			request.AddField ("challenged", challenged);
			request.AddField ("token", PlayerPrefs.GetString("token"));
			request.Send ();
		}
	}
开发者ID:mengtest,项目名称:movieschallenge_client,代码行数:17,代码来源:CreateGame.cs

示例7: sendQuestion

	public void sendQuestion() {
		API request = new API ();
		request.Post ("/question", processResponse);
		request.AddField ("token", PlayerPrefs.GetString("token"));
		request.AddField ("quote", _quote.text);
		request.AddField ("category", _category.text);
		request.AddField ("difficulty", _difficulty);
		request.AddField ("correctAnswer", _correctAnswer.text);
		request.AddField ("otherAnswers", JsonMapper.ToJson(new string[] {
			_wrongAnswer1.text,
			_wrongAnswer2.text,
			_wrongAnswer3.text,
			_wrongAnswer4.text,
			_wrongAnswer5.text
		}));
		request.Send ();
	}
开发者ID:mengtest,项目名称:movieschallenge_client,代码行数:17,代码来源:ContributeSendScript.cs


注:本文中的API.Post方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。