How i can make API call to our external API. I tried to use fetch , but it misses complete cookies list in the request header.
Is there any service already present in Kibana which i can reuse.
Trying to make call from src\core\public\chrome\ui\header\header.tsx to external API.
Please help team! Thanks in Advance.
it misses complete cookies list in the request header.
Do you mean the cookies for your external API? If yes you probably need to set
credentials: 'include' on the fetch call: Using Fetch - Web APIs | MDN
Thanks for quick reply
Atually for other rest api calls in kibana we have multiple cookies in request header
I want to send multiple cookies in case of external API under request header.
when using credentials: 'include' , it just sends a single cookie(first one) as a result api gets failed.
Any idea why it is not sending all the cookie?
I don't think this is related to Kibana - for this kind of request it's just a CORS request like any other. Please try to make a similar request from within another web app (not hosted on the same host as the external api) - I suspect it will have the same issue.
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.