on 02-02-2016 8:27 AM
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
Hi Matthias,
Your status 400 request should be like this:
aBatchOperations.push(oModel.createBatchOperation(
"/BusinessPartnerSet?$filter=Type+eq+'Employee'+and+PartnerNo+eq+'373'",
"GET")); //Status 400
Try this and let me know the result, thanks.
Seyed Ismail.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.