Closed tamlyn closed 9 years ago
Hi @tamlyn,
Yeah I'd definitely want to add support for this. Could you provide any example or better yet a node project (like the .net one) that has a batch endpoint that we help me develop and test against?
Thanks,
Jon
@tamlyn any progress on this?
Hopefully this is working now in the v1.11.0 release!
You will need to update your config object slightly to use the multifetch batch adapter and it should work after that.
app.config([
'httpBatchConfigProvider',
function (httpBatchConfigProvider) {
httpBatchConfigProvider.setAllowedBatchEndpoint(
'http://localhost:8080',
'http://localhost:8080/batch', {
batchRequestCollectionDelay: 500,
minimumBatchSize: 1,
ignoredVerbs: ['head', 'post', 'put', 'delete', 'patch'],
adapter: 'nodeJsMultiFetchAdapter'
});
}
]);
see the test page
https://github.com/jonsamwell/angular-http-batcher/blob/master/tests/node-multi-fetch.html
see the adapter here
Let me know if it works and suits your needs!
Coooool!
There are many batch request handlers for NodeJS (e.g. multifetch, batch-endpoint, express-batch) but they batch requests by specifying them in the query string and combining the JSON responses in the body. I can't seem to find any that support
multipart/mixed
responses. Would you consider adding support for this alternate batching format? Or perhaps provide callbacks to allow customising the batching and unwrapping strategy?