title: How to send 2D array to the spring-boot post request from Postman?
body: <p>I am trying to send a POST request to spring-boot controller from the postman. The postman body will be a 2d array. I want to catch the 2d array in @requestBody and work with that array.</p>
  <p>Code:</p>
  <p>Postman schema:
  url : http://localhost:8081/api/ticTacToe/gameWinner</p>
  <pre><code>body : {
  &quot;moves&quot; : [[&quot;CROSS&quot;,&quot;CIRCLE&quot;,&quot;CROSS&quot;],[&quot;CROSS&quot;,&quot;CROSS&quot;,&quot;CROSS&quot;],[&quot;CROSS&quot;,&quot;CIRCLE&quot;,&quot;CROSS&quot;],
             [&quot;CROSS&quot;,&quot;CIRCLE&quot;,&quot;CROSS&quot;],[&quot;CROSS&quot;,&quot;CIRCLE&quot;,&quot;CROSS&quot;],[&quot;CROSS&quot;,&quot;CIRCLE&quot;,&quot;CROSS&quot;],
             [&quot;CROSS&quot;,&quot;CIRCLE&quot;,&quot;CROSS&quot;],[&quot;CROSS&quot;,&quot;CIRCLE&quot;,&quot;CROSS&quot;],[&quot;CROSS&quot;,&quot;CIRCLE&quot;,&quot;CROSS&quot;]]
  }
  
  Controller : 
  package com.example.TicTacToe.Controller;
  
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.http.HttpStatus;
  import org.springframework.http.ResponseEntity;
  import org.springframework.web.bind.annotation.PostMapping;
  import org.springframework.web.bind.annotation.RequestBody;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RestController;
  
  import com.example.TicTacToe.Service.TicTacToeService;
  
  @RestController
  @RequestMapping(&quot;/api/ticTacToe&quot;)
  public class TicTacToeController {
  private static final Logger LOGGER = LoggerFactory.getLogger(TicTacToeController.class);
  @Autowired
  TicTacToeService gameService;
  
  @PostMapping(&quot;/gameWinner&quot;)
  public ResponseEntity&lt;String&gt; resultOfTheGame(@RequestBody String[][]moves){
      
      try {
          String winner = &quot;&quot;;
          
          winner = gameService.winnerOfTheGame(moves);
          
          if(winner.equals(&quot;CROSS&quot;)){
              System.out.println(&quot;CROSS wins!&quot;);
          }else if(winner.equals(&quot;CIRCLE&quot;)){
              System.out.println(&quot;CIRCLE wins!&quot;);
          }else{
              System.out.println(&quot;Draw!&quot;);
          }
          
      }catch(Exception e) {
          LOGGER.error(&quot;Exception Thrown {}&quot;, e.getLocalizedMessage());
          return new ResponseEntity&lt;&gt;(e.getLocalizedMessage(),HttpStatus.EXPECTATION_FAILED);
      }
      
      return null;
      
      }
  
  }
  </code></pre>