ここでLiveSDKを使用してSkyDriveにフォルダーを作成する方法について読みました(ここでは「boundary」パラメーターについては言及していません)。ここに私のコードがあります。
WebRequest request = WebRequest.Create("https://apis.live.net/v5.0/folder.77e1a950546be643.77E1A950546BE643!202/files/");
request.Method = "POST";
string postData = "{name: \"My example folder\"}";
byte[] byteArray = Encoding.UTF8.GetBytes(postData);
request.Headers.Add("Authorization", "Bearer " + access_token);
request.ContentType = "application/json";
request.ContentLength = byteArray.Length;
そして、なぜ私が400を返すのかわからない:
{"error":{"code": "request_header_invalid"、 "message":"提供されたヘッダー'Content-Type'に必須パラメーター'boundary'がありません。" }}
私が間違っていることは何ですか?何か足りないものはありますか?
御時間ありがとうございます!