The following code example retrieves the site logo and saves it in the caller's temporary directory:
Plug p = Plug.New("http://deki-hayes/@api/deki");
p.At("users", "authenticate").WithCredentials("admin", "password").Get();
DreamMessage msg = p.At("site", "logo").Get();
using (FileStream fs = System.IO.File.OpenWrite(Path.GetTempPath() + msg.ContentDisposition.FileName))
{
byte[] fileData = msg.AsBytes();
fs.Write(fileData, 0, fileData.Length);
}
Add notes about requirements or config values
| Images 0 | ||
|---|---|---|
| No images to display in the gallery. |
Copyright © 2011 MindTouch, Inc. Powered by