Request HTTP cannot path the Cookie Authentification

Hello,

Here is my code :

const result = await getBackendSrv().datasourceRequest({
            method: "POST",
            url: "URL",
            headers: {
                "Content-Type": "application/json; charset=UTF-8",
                Credential: "include",
                Cookie: {
                    name: "value",
                    Set: "value",
                    httpOnly: true,
                    origin: 'http://localhost:3000',
                }
                
            },
            data: JSON.stringify(testjsonobj.valueOf())
        })
        return result;

With this request I have the following error :

"Object reference not set to an instance of an object."

And with all my test i conclude that this is because the cookie set doesn’t work so I can’t log to my API.

Did anyone have an idea for this problem ?

Nicolas