How can i get the Header value in the WcfwebApi using the Handler before entering the Web-method .
You can use an OperationHandler<RequestMessage, RequestMessage>
It gets passed a RequestMessage in which you can access the the headers:
public class HeaderAccessRequestHandler : HttpOperationHandler<HttpRequestMessage, HttpRequestMessage> {
public HeaderAccessRequestHandler() : base("request") {
}
public override HttpRequestMessage OnHandle(HttpRequestMessage request) {
request.Headers.Remove("Accept"); // remove value and
request.Headers.Add("Accept","text/html"); // set it new = update
return request;
}
}