title: Send form in JSON using Thymeleaf and Spring boot
body: <p>I'm using a form using Thymeleaf to send data to my Service.</p>
  
  <p>Here is my Form:</p>
  
  <pre><code>&lt;form th:object="${individualEntity}" th:action="@{/save}" method="post"&gt;
  &lt;div class="form-group"&gt;
      &lt;label&gt;FirstName:&lt;/label&gt;
          &lt;input type="text" class="form-control" th:field="*{individualName.givenName}"/&gt;
  &lt;/div&gt;
  &lt;div class="form-group"&gt;
      &lt;label&gt;LastName:&lt;/label&gt;
          &lt;input type="text" class="form-control" th:field="*{individualName.surname}"/&gt;
  &lt;/div&gt;
  &lt;div class="form-group"&gt;
      &lt;label&gt;Address:&lt;/label&gt;
      &lt;input type="text" th:field="*{address}"/&gt;
  &lt;/div&gt;
  
  &lt;div class="row"&gt;
      &lt;button type="submit"&gt;Submit&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>When I debug the request sent using this form it gives me this data : individualName.givenName=xxxx&amp;individualName.surname=xxxxx&amp;address=xxxx</p>
  
  <p>However I want that it will be in JSON when sending because my microservice consumes JSON.</p>
  
  <p>What should I do to correct that !</p>
  
  <p>Here is my service:</p>
  
  <pre><code>    @PostMapping(value = "save")
  public String saveIndividual(Individual individual){
      individualService.saveIndividual(individual);
      return "redirect:/getIndividual/" + individual.getId();
  }
  </code></pre>
  
  <p>Thanks</p>