public. Export a page to the specified format
The Content-Disposition, Content-Length, and Content-Type headers provide information about the retrieved file.
The following code example exports the page called "Page_Title" to a pdf 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("pages", "=Page_Title", "export").With("format", "pdf").Get();
using (FileStream fs = System.IO.File.OpenWrite(Path.GetTempPath() + msg.ContentDisposition.FileName)) {
byte[] fileData = msg.AsBytes();
fs.Write(fileData, 0, fileData.Length);
}