You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The root endpoint url is simply the base address of your api and the endpoint batch address is the url of the method that can accept the batch request (usually just /batch or /$batch). You are able to pass some optional configuration paramaters to this call in the third argument (see below)
53
54
54
-
The setAllowedBatchEndpoint has some options that can be passed in as a third paramter to the call which are explained below.
55
+
The setAllowedBatchEndpoint has some options that can be passed in as a third parameter to the call which are explained below.
55
56
56
57
```language-javascript
57
58
{
@@ -60,10 +61,67 @@ The setAllowedBatchEndpoint has some options that can be passed in as a third pa
60
61
batchRequestCollectionDelay: 100,
61
62
ignoredVerbs: ['head'],
62
63
sendCookies: false,
63
-
enabled: true
64
+
enabled: true,
65
+
adapter: 'httpBatchAdapter' //defaults to this value we currently also support a node js multifetch format as well
64
66
}
65
67
```
66
68
69
+
####adapter
70
+
The key for the adapter to use. Defaults to the HTTP 1.1 adapter 'httpBatchAdapter'.
71
+
Current adapters are:
72
+
'httpBatchAdapter' - supports the HTTP 1.1 spec and used by .Net (WebAPI) and JAVA servers.
73
+
'nodeJsMultiFetchAdapter' - supports batching GET requests to a node server that uses the multifetch library.
74
+
Coming soon:
75
+
'facebookAdapter' - will support the facebook batching protocol.
76
+
77
+
Please request adapters that are not present.
78
+
79
+
Adapters convert http requests into a single batch request and parse the batch response. They consist of two methods defined below.
80
+
81
+
This adapter parameter can also be an object with the two below functions if you need to be more specific about the way
82
+
requests and responses are handled.
83
+
84
+
```javascript
85
+
/**
86
+
* Builds the single batch request from the given batch of pending requests.
87
+
* Returns a standard angular httpConfig object that will be use to invoke the $http service.
var batchResponses = []; // array of HttpBatchResponseData
118
+
119
+
//do processing..
120
+
121
+
return batchResponses;
122
+
}
123
+
```
124
+
67
125
####maxBatchedRequestPerCall
68
126
The maximum number of single http request that are allow to be sent in one http batch request. If this limit is reached the call will be split up into multiple batch requests. This option defaults to 10 request per batch but it is probably worth playing around with this number to see the optimal batch size between total request size and response speed.
Copy file name to clipboardExpand all lines: dist/ChangeLog.txt
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,8 @@
1
+
11/08/2015 V1.11.1
2
+
Added support for the Angular Json protection vulnerability when parsing json (see https://docs.angularjs.org/api/ng/service/$http#json-vulnerability-protection)
3
+
thanks to @riann (https://github.com/riaann) for this!!
4
+
Added documentation for the new 'adapter' config property and tests around the node js multifetch adapter.
5
+
1
6
10/08/2015 V1.11.0
2
7
HUGE refactor of the library geared towards supporting multiple different formats of batch request and response i.e.
3
8
http 1.1 batch, NodeJS, Facebook etc. The library now has the concept of batch adapters which are able to transform raw
0 commit comments