Get
1. JSON data
- By default when you fetch json data from server, it will be parsed and you will get a javascript object in data property of HpResponse object.
note
Here, res is just a javascript Response object, so you can also parse data as shown below.
2. Text data
- if you are fetching text data then you just need to set
textas responseType and the data property of HpResponse will havetextdata.
note
Here, res is just a javascript Response object, so you can also parse data as shown below.
3. Blob data
- To get blob data from response you just need to set
blobas responseType and in data property of HpResponse object will haveblobdata.
note
Here, res is just a javascript Response object, so you can also parse data as shown below.