Custom HTTP Headers using AngularJS client for Nuxeo platform
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2015 04:08 AM
Is there a way I could specify custom HTTP Headers using AngularJS client? Options from the REST API are specified on that page : https://doc.nuxeo.com/display/NXDOC/Special+HTTP+Headers
But I don't know how I can specify them using the AngularJS client.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2015 04:32 AM
I've found the answer. I could specify custom headers to the nuxeoClient using this instruction below before calling the API method :
nuxeoClient.header('X-NXDocumentProperties', '*');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2015 04:39 AM
You can also set headers only for specific requests. All the different objects returned by the js client provide two methods for that: header(name,value) / headers (object) methods.
Some examples:
myclient.operation('Document.GetChildren')
.input('doc:/').header('X-NXenrichers.document','thumbnail').execute().then(...);
myclient.document('/').header('X-NXenrichers.document','thumbnail').fetch().then(...);
myclient.request('path/').headers({'X-NXenrichers.document':'thumbnail','X-NXproperties':'*'}).fetch().then(...);
