こんにちは、Azure BLOB サービス API http://msdn.microsoft.com/en-us/library/dd135733.aspx
c# を使用して呼び出すことができます。Word文書などのファイルを保存場所にアップロードしたいのですが、httpメソッドは「put」で、残りのURLは
" http://myaccount.blob.core.windows.net/mycontainer/myblob "
このコードは動作しますか?
string username = "user";
string password = "password";
string data = "path to word document;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Method = "PUT";
request.Credentials = new NetworkCredential(username, password);
request.ContentLength = data.Length;
request.ContentType = "text/plain";
using (StreamWriter writer = new StreamWriter(request.GetRequestStream( ))) {
writer.WriteLine(data);
}
WebResponse response = request.GetResponse( );
using (StreamReader reader = new StreamReader(response.GetResponseStream( ))) {
while (reader.Peek( ) != -1) {
Console.WriteLine(reader.ReadLine( ));