Bram
11/19/2024, 8:56 PM// security header
requestMessage.Headers.Add("Api-Key", _options.CurrentValue.FormsKey);
var response = await _httpClient.SendAsync(requestMessage);
if (!response.IsSuccessStatusCode)
{
_logger.LogError("Umbraco Forms API did not return successful while adding record for newsletter, response {Response}",
await response.Content.ReadAsStringAsync());
return false;
}
Even though I have these appsettings:
"Options": {
"EnableFormsApi": true,
"EnableAntiForgeryTokenForFormsApi": false,
},
"Security": {
"FormsApiKey": "[the correct key]"
}
Is anyone familiair with how to fix this issue?
I've even tried turning AntiForgery tokens off completely by using the Options:EnableAntiForgeryToken to false but this also doesn't work.Florent Grandjean
04/29/2025, 7:54 AM