Hello everyone.
I would like to ask you, is it possible to send a post request in Angular with the link to the image that I want and then from the API get an image without using an HTTP.GET request but only an HTTP.POST one?
The reason why is because all the images I need are stored in a Synology NAS server on a different volume from where the actual website's front-end is, so they are not accessible (as far as I know) from Angular itself.
I have been using a GET request so far but I realised that if another user from another PC requests a different image the two images may be swapped and both the users will receive the wrong one or an error.
What I have tried:
I already tried in my Express server to:
res.sendFile(path.resolve(imagePath));
but then in the front end (in the inspector) I get
error: SyntaxError: Unexpected token � in JSON at position 0
In the front-end I got
res=>
{
console.log("The path is set!", res)
this.getImage(this.url_toService).subscribe(x => this.url = x);
console.log("reciving from Recerive2");
},
But because the error part of the callback is executed the code never gets to the
this.GetImage(...)