I have a simple yet tricky question about postman flow. How to display a generated image in the output block ?
When I run the request that create the image in classique mode my image is correctly rendered in the response body
But when I call the same request in flow, the image is not displayed While a the link of an image is displaying the image correctly.
The endpoint that return the image is flagued with the good return type
@GetMapping(value = "/generateQR/{id}", produces = MediaType.IMAGE_PNG_VALUE)
@PreAuthorize("hasAnyAuthority('ROLE_KAMINOAIN')")
public @ResponseBody byte[] generateQRCode(@PathVariable("id") Long id) throws Exception {
Clone clone = getOne(id);
return barCodeService.generateQRCodeImage(clone.toString());
}
I know that flow is a feature still in developement, so maybe it's not yet possible. But if anybody know how to render the image, it'will help.
So after some time I have found some work around
Now my service don't send a byte array but a base64 encoded string that represent it
@GetMapping(value = "/generateQR/{id}")
@PreAuthorize("hasAnyAuthority('ROLE_KAMINOAIN')")
public @ResponseBody String generateQRCode(@PathVariable("id") Long id) throws Exception {
Clone clone = getOne(id);
var qrcode = barCodeService.generateQRCodeImage(clone.toString());
return Base64.getEncoder().encodeToString(qrcode);
}
Then in postman flow, in place of displaying the image just after getting it, I added a template bloc