Aylık Arşiv: Mart 2016

WCF – Get Client Header

WCF – Get Client Header

try { IncomingWebRequestContext request = WebOperationContext.Current.IncomingRequest; WebHeaderCollection headers = request.Headers; foreach (string headerName in headers.AllKeys) { if (headerName != "X-Forwarded-For") { continue; } return headers[headerName]; } } catch (Exception) { }