Using ReactJS, I have a GET request working with fetch method, and the REST API responds with a few files. How would they be sent to me?
Meaning, can it be parsed with response.json(), so that it can be displayed as actual files from REST API and also be downloaded to local drive?
Here is the method that makes the GET request:
sendFileRequest() {
...
return dispatch => {
dispatch({
type: 'FETCH_API'
});
return fetch('http://11.22.33.44:8080/receive/files', getRequest)
.then(response => response.json()) //Could I do .json() with files being the response?
.then(APIfiles => {
//How can I parse the files returned and display them for download to local drive?
})
}