So still a noob at this, here is my code
Here is my FAST API(python) which returns a .ics
file:
@app.get("/latLong/")
async def read_item(lat: float,long:float):
mainFunc(lat,long)
return FileResponse("/tmp/myics.ics")
Now, when here is my front end via HTML:
<script>
async function apiCall(long,lat) {
let myObject = await fetch('myapi.com/lat/long');
let myText = await myObject.text();
}
</script>
So from my visor (my api logs), it successfully calls the API. But from the front end, I am trying to get it to return the file.
The end result I would like to achieve is when the user clicks a button, the browser grabs the location.
Sends the location to the API, API returns a file in which the user can download.
Thanks in advance!