我无法在Azure中创建移动服务:我收到调用移动服务的位置信息时出错:错误500:
Fehler beim Abrufen derStandortinformationenfürmobileServices:Fehler 500. Wiederholen Sie den Vorgang.Sollte das问题weiterhin bestehen,wenden Sie sich an den支持.
请注意,它不是类似问题中的错误400 无法创建Azure移动服务.
我已经阅读Atlassian的一个答案https://answers.atlassian.com/questions/79902/using-httpclient-c-to-create-a-jira-issue-via-rest-generates-bad-request-response其中一个用户通过以下代码创建了JIRA问题.我修改了它,但通过使用自构建类问题得到错误ObjectContent
Http.HttpContent content = new Http.ObjectContent<Issue>(data, jsonFormatter);
Run Code Online (Sandbox Code Playgroud)
编译器不会接受它.有人知道为什么吗?
public string CreateJiraIssue()
{
string data= @"{ ""fields"": {
""project"":
{
""key"": ""HELP""
},
""summary"": ""Test Ticket"",
""description"": ""Creating of an issue using project keys and issue type names using the REST API"",
""issuetype"": {
""name"": ""Ticket""
},
""assignee"": { ""name"": ""user"" }
}
}";
string postUrl = "https://xxx.jira.com/rest/api/2/";
System.Net.Http.HttpClient client = new System.Net.Http.HttpClient();
client.BaseAddress = new System.Uri(postUrl);
byte[] cred = UTF8Encoding.UTF8.GetBytes("username:password");
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(cred));
client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); …Run Code Online (Sandbox Code Playgroud)