External API Call in kibana 7.10.2

Hi Team,

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
something like:
JSESSIONID=7D1026E51294445448132A0E7F0E7188F5; JSESSIONID=942B9049AA036DF45468B97C077C366E8;
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.