I'm trying to implement a standalone WCF REST service. One problem I currently have is that I have to send custom objects, which WebGet can't handle. So I'm trying to send them with POST instead of GET.
Now of course I can't make a JSONP request with POST data. To work around this, I have to send a ALLOW-ORIGIN header to all calls made with the "OPTIONS" HTTP-method. Is there
- A way to apply a header to each OPTION call?
- A way to intercept and allow all OPTION-calls without setting
[WebRequest(method = "*")]
(instead of[WebRequest(method = "POST")]
- A way to add the headers and return the request without it calling the WCF method?
Or alternatively, how can I override the parameter-serialization method of WebGet?
I already tried to solve this with custom Endpoints and MessageDispatchers, but it doesn't seem to work.