Request headers CSV without compressor

Resolved
Davide Malagoli asked on May 8, 2019

Hi,
I do not understand if there's an option to pass a custom header for every request made by flexmonster using a CSV/JSON datasource.
For example I need to pass and header 'auth-token' with a authentication token.
Is this possible?
 
Thank you,
 
-Davide

2 answers

Public
Vera Didenko Vera Didenko Flexmonster May 9, 2019

Hello, Davide,
 
Thank you for your question.
 
Yes, it is possible to pass a custom header for CSV/JSON data sources in Flexmonster.
 
This is done via the requestHeader parameter in the dataSource object:
 

dataSource: {
filename:"https://cdn.flexmonster.com/data/data.json",
dataSourceType:"json",
requestHeader: {
'Authorization':"znati 21521512454"
}
}

Here is a JSFiddle example for illustration.
 
The requestHeader consists of "key": "value" pairs, where "key" is a header name and "value" is its value.
An important remark is that the requestHeader is not saved when obtaining the report via save() and getReport() API calls.
 
Please let us know if this works.
 
Best Regards,
Vera

Public
Davide Malagoli May 13, 2019

thanks, it works!

Please login or Register to Submit Answer