This project is read-only.
1
Vote

Batch operation returns empty response

description

Hi,

I'm issuing a batch operation that returns statusCode 202 but the response is empty.
The batch includes several GET requests that work fine when issued alone (i.e. in a separate request).
For example:
<ServiceURI>/MyObjects(guid'00505695-007C-1ED5-9CB8-6B359297A375') - works fine,
and so is: <ServiceURI>/MyObjects - that returns all entries.
... but when sent together as a batch request - none of them returns any response,
and as you can see - I tried several options (slash at the beginning, no slash, etc...)

Any idea?

Here's the batch request code:

OData.request({
requestUri: serviceUrl + "/$batch",
    method: "POST",
    data: {
        __batchRequests: [
          { requestUri: "/MyObjects?$expand=toactions&$format=json&$inlinecount=allpages", method: "GET"},
          { requestUri: "/MyObjects(guid'00505695-007C-1ED5-9CB8-6B359297A375')", method: "GET"},
          { requestUri: "MyObjects", method: "GET"},
          { requestUri: "MyObjects(guid'00505695-007C-1ED5-9CB8-6B359297A375')", method: "GET"},
          { requestUri: "GetCount", method: "GET"},
          { requestUri: "/GetCount", method: "GET"}
       ]
    },
    headers: {
        "X-Requested-With": "XMLHttpRequest",
        "Content-Type": "multipart/mixed",
        "DataServiceVersion": "2.0",       
        "X-CSRF-Token": sHeaderXcsrfToken
    }
Thanks,

Dan

comments

k10world wrote Dec 25, 2015 at 1:27 AM

What version of ODATA are you using?