Error using batch request against WebAPI odata

Mar 21, 2014 at 7:42 PM
I have a webapi odata feed set up and it woks fine. However when I need to include a lot of filters in the request i'm exceeding the url size limitations and it is erroring out.

I'm trying to use the datajs batch functionality to get around this issue.

I have this javascript code L
  var requestData = {
            __batchRequests: [{
                __changeRequests: [
                        requestUri: suburl, method: "GET"


            requestUri: FixPortal.Common.serviceUrl.batchDartOdataUrk,
            method: "POST",
            data: requestData
        }, function (data, textStatus, jqXHR) {

           function (result) {
               alert("Due to unexpected errors we were unable to load Trades" + result.responseText);
But I always get an error saying "The batch request of media type 'application/json' is not supported."

Here's the request from fiddler:
POST http://sgm1dtapp1:91/DartOData/api/$batch HTTP/1.1
Content-Type: application/json
Accept-Language: en-us
dataserviceversion: 1.0
Accept: application/atomsvc+xml;q=0.8, application/json;odata=fullmetadata;q=0.7, application/json;q=0.5, */*;q=0.1
maxdataserviceversion: 3.0
Referer: http://sgm1dsps06/sites/testing/GeraldFixPortal/TradeSummary.aspx
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E; InfoPath.3)
Host: sgm1dtapp1:91
Content-Length: 299
Connection: Keep-Alive
Pragma: no-cache

{"__batchRequests":[{"__changeRequests":[{"requestUri":"/odata/TT_Trades?$select=ID,TrinityTrade_ID,Exchange,Entity,Portfolio,BS,Lots,Delivery,Trader, TradeDate,TradeMonth,Curr,Strike&$expand=TT_PreTrades&$filter=(Processing_Status ne 'BYPASSED') and ((Portfolio eq 'ADVANCES'))","method":"GET"}]}]}
and here's the response
HTTP/1.1 400 Bad Request
Cache-Control: no-cache
Pragma: no-cache
Content-Type: application/json; charset=utf-8
Expires: -1
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Fri, 21 Mar 2014 19:25:39 GMT
Content-Length: 82
{"Message":"The batch request of media type 'application/json' is not supported."}

Does anyone have any idea ghow to fix this?