Skip to content Skip to sidebar Skip to footer

Angular Post Binary Data

I am trying to post binary data using the code below : let headers = new Headers() headers.append('Content-Type', 'application/json') this.http.post('http://localhost:8080/api/loa

Solution 1:

Had to manually create the request using XMLHttpRequest.

The final code looks something like this :

const httpRequest = new XMLHttpRequest()
httpRequest.open('POST', 'http://localhost:8080/api/restaurant/load', true)
httpRequest.responseType = "arraybuffer"
httpRequest.send(requestBytes)

Post a Comment for "Angular Post Binary Data"