I am using CosmosDB with Blazor WebAssembly (client side).
I have noticed one thing, every time there are two same request occur for data. I have attached that extra request detail image. I want to stop that extra request [Request Method : Option]
Code Sample :
// Get credential token
Credential Credentials = await Http.GetFromJsonAsync<CosmosCredentials>("api/Cosmos/GetCred?permissionId=" + MemberOfOrganization.PermissionId);
CosmosClientOptions clientOptions = new CosmosClientOptions()
{
ConnectionMode = ConnectionMode.Gateway,
ApplicationPreferredRegions = new List<string>() { Regions.JapanEast } // Specified explicitly because automatic is not working, improve later
};
client = new CosmosClient(Credentials.EndPoint, Credentials.ResourceToken, clientOptions);
orgContainer = client.GetContainer(databaseName, containerName);
// Request for cosmos document
OrganizationMonthlyInfo organizationMonthlyInfo = await orgContainer.ReadItemAsync<OrganizationMonthlyInfo>(id, new PartitionKey(partitionKey));