on 02-28-2022 12:51 PM
Hello,
Here we are trying to get oData service with authentication in irpa cloud studio, we tried to use this piece of code
For credentials we used "Encode string"
async function fetchToken() {
const options = {
resolveBodyOnly : false,
method: 'GET',
url: " OUR URL ",
headers: {
'Accept' : 'application/json',
'Content-Type': 'application/json',
'Authorization' : 'Basic ' + credentials,
'x-csrf-token': 'fetch'
}
};
try {
const response = await irpa_core.request.call(options);
return response;
} catch (error) {
const csrfToken = error.response.headers['x-csrf-token'];
return error;
}
}
let response = await fetchToken();
return response.headers;
But we are getting error as "Cannot read property 'headers' of undefined". How to resolve this issue and also how to read odata service with authentication?
Thanks,
Ramya.T
I am also getting the same error, Can you please help me how to solve this error.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you please try to debug and/or write the error.response to the console.
Also please check that you are using the latest irpa_core SDK (update your dependencies in your project)
hope this helps, regards Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
68 | |
8 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.