REST API (C# を使用) を使用して VersionOne でスケジュールを作成しようとしています。彼らの「Create a New Asset」ページに従って、XML を取得するリクエストを発行し、2 つのプロパティ (TimeboxLength と TimeboxGap) を設定して送り返しました。応答は、リモート サーバーがエラーを返しました: (404) 見つかりません。
喜びではなく、ベースURLとスコープレベルのURLで作成しようとしました。
私のコードは次のようになります。
request = WebRequest.Create(string.Format("{0}/rest-1.v1/Data/",url)) as HttpWebRequest;
request.Credentials = System.Net.CredentialCache.DefaultCredentials;
request.Method = "POST";
request.ContentType="application/xml";
using (StreamWriter rs = new StreamWriter(request.GetRequestStream()))
{
//This string is the populated xml skeleton retrieved from the website
string schedule = string.Concat("<?xml version='1.0' encoding=\"UTF-8\"?>",
"<Asset href=\"/WUP/rest-1.v1/New/Schedule\">",
" <Attribute name=\"TimeboxLength\" act=\"set\">42 Days</Attribute>",
" <Attribute name=\"TimeboxGap\" act=\"set\">2 Days</Attribute>",
"</Asset>");
rs.Write(schedule);
rs.Flush();
rs.Close();
}
try
{
response = request.GetResponse() as HttpWebResponse;
}
catch (WebException we)
{
System.Diagnostics.Debug.WriteLine(we.Status.ToString());
}
これは oauth の問題ではないと思います。現在、資格情報キャッシュを使用するだけで機能しています。誰かが私が間違っていることを指摘できますか?
前もって感謝します。