DotNetOpenAuth を使用して Jira と通信する際に問題が発生しました。
var payload =
new {
fields = new
{
project = new { id = 10000 },
summary = summary,
description = description,
issuetype = new { id = (int)issueTypeId }
}
};
webRequest = OAuthConsumer.PrepareAuthorizedRequest(
new MessageReceivingEndpoint(url, HttpDeliveryMethods.PostRequest),
accessToken
);
byte[] payloadContent = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(payload));
webRequest.ContentLength = payloadContent.Length;
using (var stream = webRequest.GetRequestStream())
{
stream.Write(payloadContent, 0, payloadContent.Length);
}
ただし、 webRequest.GetRequestStream() は例外をスローするだけですThis property cannot be set after writing has started.
http://docs.atlassian.com/jira/REST/latest/#id120664を使用して新しい問題を作成しようとしています。OAuth ではなく基本認証を使用し、GET を使用した他のすべての OAuth 呼び出しが正常に機能する場合、コードは正常に機能します。
Jira で DotNetOpenAuth を使用する際のアドバイスはありますか?
ありがとう!