Closed EvgeniyReznichenko closed 7 years ago
Sorry but hal-rest-client
is done to manage HALResource.
theimage
field, is not an @HalProperty(), it can not be save with the rest of entity name
field.
Hal only manage JSON format and not FormData
, I don't think that is a good idea.
your /avatar
endpoint is not a rest service.
You can look at this forum https://stackoverflow.com/questions/4083702/posting-a-file-and-associated-data-to-a-restful-webservice-preferably-as-json who have multiple solution to do a restfull service with image upload.
Hello,
I'm wondering if it is possible to upload the file during the new Resource creation? e.g:
On the HTML view lets assume we have something like that
TS method looks as below:
So this example works and the Ajax call is being made successfully, However the payload is incorrect since image field does not send the File but empty object:
At the same time if I'll do the same without using hal rest client (via native xhr), the request will be correct! e.g:
Network log: