tags:

views:

775

answers:

2

I've been looking for examples for how to write a WCF REST service that allows image data to be POSTed to. I may be missing something (I generally am), but does anyone know how to do it? Is it as simple as getting the HTTP request from inside your WCF REST service, and extracting the binary data? If so, is there an example as to how to do that? Would I be able to do that using WebOperationContext.IncomingRequest?

Or, is there a way to do something like this...

[ServiceContract]
public interface IImage
{
    [OperationContract]
    [WebInvoke(
        Method = "POST",
        UriTemplate = "/images")]
    void StoreImage(byte[] imageData);
}

Any ideas?

+2  A: 

This post is more or less the answer I was looking for.

unforgiven3
A: 

Perfect- cheers for posting :)

Shawson
nice answer. ;)
kenny