I have a Blazor WASM PWA that I want to be standalone (if possible).
Currently, I am trying to manipulate a json file under wwwroot
Now, while I am able to read its contents via HttpClient.GetFromJsonAsync, all other attempts to access the File fail.
What I've tried:
- Check if the File exists via File.Exists -> returns false
- Post objects via HttpClient.PostAsJsonAsync -> returns 404 for the Json-File
I know that in WebAssembly, Files are cached/loaded into the browser, so I get why I should be unable to locate the File with a Path like "/datasource-json/Ingredient.json", but why does "GetFromJsonAsync" work with that path then?
Is there something crucial I am missing, and how can I work my way around this? For this particular project, I do not want to use another Api-Project + Entity Framework if possible.