protected async override Task <HttpResponseMessage> SendAsync(
            HttpRequestMessage request, CancellationToken cancellationToken)
        {
            if (!ValidateAcceptsSData(request.Headers.Accept))
            {
                // consumer does NOT want SData so let Web API handle this as is
                return(await base.SendAsync(request, cancellationToken));
            }

            Uri originalUri = request.RequestUri;

            // check if this server only specified some routes mapped to SData
            if (TargetRoutPrefix != null && TargetRoutPrefix.Trim() != "" &&
                !originalUri.AbsolutePath.StartsWith(TargetRoutPrefix, StringComparison.InvariantCultureIgnoreCase))
            {
                // there's a targeRoutePrefix specified so skip mapping if this
                // URL doesn't start with the prefix
                return(await base.SendAsync(request, cancellationToken));
            }

            // convert/translate SData query keys (where, startIndex, etc.)
            Uri newUri = originalUri.TransformToSData();

            request.RequestUri = newUri;

            // replace consumer's Accept Header with OData nometadata so we get json in format we want
            var origAccept = request.Headers.Accept;

            request.Headers.Accept.Clear();
            MediaTypeWithQualityHeaderValue noMetadataHeader = new MediaTypeWithQualityHeaderValue(JSON_MEDIA_TYPE);

            noMetadataHeader.Parameters.Add(new NameValueWithParametersHeaderValue("odata", "nometadata"));
            request.Headers.Accept.Add(noMetadataHeader);

            // URL and Headers have been mapped to OData; we now have an OData request
            var response = await base.SendAsync(request, cancellationToken);

            if (ResponseIsValid(response))
            {
                // OData request was handled and is valid so now transform Content/Payload to SData
                response.Content = new SDataContent(response, maps);
            }
            else if (errResponseBuilder != null)
            {
                // add the original accepts back
                origAccept.ToList().ForEach(i => request.Headers.Accept.Add(i));

                response = errResponseBuilder.BuildErrorResponse(request, response);
            }

            return(response);
        }