title: Returning multiple images in one ResponseEntity body
body: <p>I'm using spring boot to save some images to the db along with an order. I am able to return a single image at a time but I would like to return 2 or more images in the body. I tried using arrays or arrayLists but that didn't work.
  Is there a way to return multiple images ?</p>
  <p>My code</p>
  <pre><code>    @GetMapping(value = &quot;/getOrder&quot;)
      public ResponseEntity getOrder(@RequestParam Long input_id) {
          try {
              Optional&lt;OrderItems&gt; orderItemOptional = materialService.getOrder(input_id);
  
              if (!orderItemOptional.isEmpty()) {
  
                  byte[] imageBytes = orderItemOptional.get().getEyewearImage().getImage();
  
                  return ResponseEntity.ok().contentType(MediaType.IMAGE_JPEG).body(imageBytes);
  
              } else {
                  return ResponseEntity.badRequest().body(&quot;Bad request&quot;);
              }
  
          } catch (Exception e) {
              LOGGER.warn(e.getMessage(), e);
              return ResponseEntity.badRequest().body(e.getMessage());
          }
      }
  
  </code></pre>