I found error on CyberSource.Api.ReportDownloadAPI- DownloadReportAsyncWithHttpInfo. I'm using package CyberSource.Rest.Client.NetStandard. Whenever I call that method with all required and valid configurations, i got error "An item with the same key has already been added. Key: Vary''. After debugging sometime i came to know that error is on this line=
return new ApiResponse<object>(statusCode, restResponse.Headers.ToDictionary((HeaderParameter x) => x.Name, (HeaderParameter x) => x.Value.ToString()), restResponse.Content);.
On this restResponse.Headers there're 2 vary key which is causing error.
Thank you.
Pramesh KC
07-15-2024 06:38 PM
The error arises because rest Response. Headers contains duplicate Vary keys. You can handle this by modifying the code to handle duplicate keys, or by filtering the headers to ensure each key is unique before creating the ApiResponse object.
07-20-2024 12:16 AM