Hello Experts,
I have a question regarding $batch 'GET' requests. I have found multiple posts which explain 'POST' $batch requests but they are not applicable to my problem with 'GET' requests.
I want to send multiple 'GET' requests to the OData service in one $batch request. My problem: the requests either abort with a 400 (Bad Request) or get through (Status 200, Debugger starts) but contain no filter string. Below you find my Coding.
Can you tell me if the url needs to have a special format so the request works?
//##################TESTING################\\ var oModel = new ODataModel("/sap/opu/odata/sap/{SERVICE}"); var aBatchOperations = [ ]; aBatchOperations.push(oModel.createBatchOperation( "/BusinessPartnerSet?Type='Employee'&Name='Max Mustermann'", "GET")); //Status 200 but no filter aBatchOperations.push(oModel.createBatchOperation( "/BusinessPartnerSet?$filter=Type eq 'Employee' and PartnerNo eq '373'", "GET")); //Status 400 oModel.addBatchReadOperations(aBatchOperations); oModel.setUseBatch(true); oModel.submitBatch(function(oData, oResponse) { //process response }); //##################TESTING################//
Thanks in advance,
Matthias