51 lines
1.6 KiB
JavaScript
51 lines
1.6 KiB
JavaScript
export const azureHeaders = (access_token) => {
|
|
return {
|
|
headers: {
|
|
"OData-MaxVersion": "4.0",
|
|
"OData-Version": "4.0",
|
|
"Accept": "application/json;odata.metadata=none",
|
|
"Prefer": 'odata.include-annotations="*",return=representation',
|
|
"Content-Type": "application/json",
|
|
"Authorization": "Bearer " + access_token
|
|
}
|
|
};
|
|
};
|
|
|
|
export const azureHeadersNoOdata = (access_token) => {
|
|
return {
|
|
headers: {
|
|
"Content-Type": "application/json",
|
|
"Authorization": "Bearer " + access_token
|
|
}
|
|
};
|
|
};
|
|
|
|
export const azureHeadersPaged = (access_token) => {
|
|
return {
|
|
headers: {
|
|
"OData-MaxVersion": "4.0",
|
|
"OData-Version": "4.0",
|
|
"Accept": "application/json;odata.metadata=none",
|
|
"Prefer":
|
|
'odata.include-annotations="*",return=representation, odata.maxpagesize=10',
|
|
"Content-Type": "application/json",
|
|
"Authorization": "Bearer " + access_token
|
|
}
|
|
};
|
|
};
|
|
|
|
export const azureHeadersPagedCustom = (access_token, showNumberOfRecords) => {
|
|
return {
|
|
headers: {
|
|
"OData-MaxVersion": "4.0",
|
|
"OData-Version": "4.0",
|
|
"Accept": "application/json;odata.metadata=none",
|
|
"Prefer":
|
|
'odata.include-annotations="*",return=representation, odata.maxpagesize=' +
|
|
showNumberOfRecords,
|
|
"Content-Type": "application/json",
|
|
"Authorization": "Bearer " + access_token
|
|
}
|
|
};
|
|
};
|