예제 #1
0
        public HttpResponseMessage StaticPost(string id)
        {
            var filename    = id;
            var newEtagPost = Database.Attachments.PutStatic(filename, GetEtag(), null, InnerHeaders.FilterHeadersAttachment());

            var msg = GetMessageWithObject(newEtagPost);

            WriteETag(newEtagPost, msg);
            return(msg);
        }
예제 #2
0
        public async Task <HttpResponseMessage> StaticPut(string filename)
        {
            var newEtag = Database.Attachments.PutStatic(filename, GetEtag(), await InnerRequest.Content.ReadAsStreamAsync(), InnerHeaders.FilterHeadersAttachment());

            var msg = GetEmptyMessage(HttpStatusCode.Created);

            msg.Headers.Location = Database.Configuration.GetFullUrl("static/" + filename);

            WriteETag(newEtag, msg);
            return(msg);
        }