@sap/xsodata
Version:
Expose data from a HANA database as OData V2 service with help of .xsodata files.
18 lines (14 loc) • 520 B
JavaScript
;
const Http405_MethodNotAllowed = require('../../utils/errors/http/methodNotAllowed');
module.exports = function checkAllowedMethodForBatch(context, callback) {
const method = context.request.method.toLowerCase();
if (method !== 'post') {
return callback(
new Http405_MethodNotAllowed(
'The URI is not valid for non POST operation. OData batch requests must use POST.'
),
context
);
}
return callback(null, context);
};