Was this page helpful?

HEAD:pages/{pageid}/files/{filename}

    Overview

    public. Retrieve file attachment content (Note: image manipulation arguments are ignored for HEAD requests)

    Uri Parameters
    NameTypeDescription
    filenamestring"=" followed by a double uri-encoded file name
    pageidstringeither an integer page ID, "home", or "=" followed by a double uri-encoded page title
    Query Parameters
    NameTypeDescription
    authenticatebool?Force authentication for request (default: false)
    format{jpg, png, bmp, gif}?Convert output to given type. Default is to use original type.
    heightint?Height of the image
    ratio{fixed, var}?Fixed preserves aspect ratio by applying height and width as bounding maximums rather than absolute values. Variable will use the width and height given. Default: fixed
    redirectsint?If zero, do not follow page redirects (only applies when {pageid} is present).
    revisionstring?File revision to retrieve. 'head' by default will retrieve latest revision. positive integer will retrieve specific revision
    size{original, thumb, webview, bestfit, custom}?Return a resized image from one of the preset cached sizes. Use 'thumb' or 'webview' to return a smaller scaled image. Use 'bestfit' along with height/width to return one of the known sizes being at least the size given. Default: original
    widthint?Width of the image
    Return Codes
    NameValueDescription
    BadRequest400Invalid input parameter or request body
    Forbidden403Read access to the page is required
    NotFound404Requested file could not be found
    NotImplemented501Requested operation is not currently supported
    Ok200The request completed successfully

    Message Format

    None

    Implementation Notes

    The Content-Length, and Content-Type headers provide information about the retrieved file.

    Code Samples

    The following code example retrieves the headers for the file called "myfile.jpg" on the home page:

    Plug p = Plug.New("http://deki-hayes/@api/deki");
    p.At("users", "authenticate").WithCredentials("admin", "password").Get();
    DreamMessage msg = p.At("pages", "home", "files", "=myfile%252ejpg").Invoke("HEAD", DreamMessage.Ok());

    Sample output:

    Connection=close
    Content-Length=110326
    Content-Type=image/jpeg
    Date=Wed, 14 May 2008 22:31:30 GMT
    Server=Dream-HTTPAPI/1.5.2.25231 Microsoft-HTTPAPI/1.0
    Via=1.0 deki-hayes
    Was this page helpful?
    Tag page
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by