【发布时间】:2012-07-20 13:49:42
【问题描述】:
private void CreateNewTasklist(string TasklistTitleValue)
{
AuthenticationProcess objUri = new AuthenticationProcess();
if (string.IsNullOrEmpty(TasklistTitleValue))
{
MessageBox.Show("Please Enter the Tasklist Title.");
}
else
{
//Read the Token result in Isolated storage.
string TokenResult = TasklistManager.ReadTokenResult();
var Token = Auth.ParseAuthJsonString(TokenResult);
var request = new RestRequest(objUri.CreateTasklist, Method.POST);
request.AddHeader("content-type", "application/json");
RestClient client = new RestClient("https://www.googleapis.com");
client.Authenticator = new OAuth2AuthorizationRequestHeaderAuthenticator(Token.access_token);
client.ExecuteAsync<TasklistManager>(request, TaskListsLoaded);
}
}
在这里我得到字符串 TasklistTitleValue 值.. 我想发布它。如何将其作为内容类型添加到请求正文为 application/json。
【问题讨论】:
-
那是 RestSharp 客户端吗?看起来这可能与以下内容重复:stackoverflow.com/questions/6312970/…
标签: c# windows-phone-7 windows-phone