title: Why can't i access the properties of my JSON response?
body: <p>Im trying to make a Spring boot app with websocket communication through lobby's with ID's. When I make a post request to make a lobby it returns a String with a game ID (this works fine). I'm really not that much of a star on the frontend but I got making a game and generating, and retrieving the ID working. Then I want to join a random lobby and retrieve the Game object which the player joins randomly. When I retrieve that data I cannot access it's properties through any way. Anyone know why?</p>
  <p>Javascript code:</p>
  <pre><code>async function startGame() {
   (async () =&gt; {
     const rawResponse = await fetch('http://localhost:8080/game/newgame', {
       method: 'POST',
       headers: {
         'Accept': 'application/json',
         'Content-Type': 'application/json'
       },
       body: JSON.stringify({name: 'Gerrt'})
     });
     const content = await rawResponse.json();
  
     console.log(content);
  
     stompClient.send(&quot;/drinkordice/topic/&quot; + content);
          stompClient.subscribe('/topic/' + content, function (greeting) {
                     showGreeting(JSON.parse(greeting.body).content);
                 });
   })();
  }
  
  function joinlobby(){
  (async () =&gt; {
     const rawResponse = await fetch('http://localhost:8080/game/joinrandom', {
       method: 'POST',
       headers: {
         'Accept': 'application/json',
         'Content-Type': 'application/json'
       },
       body: JSON.stringify({name: 'Henk-Jan'})
     });
     const content = await rawResponse.json();
  
     console.log(content + &quot; &quot; + content['gameID'] + &quot; &quot; + content.gameID + &quot; &quot; + JSON.stringify(content));
  
     stompClient.send(&quot;/drinkordice/topic/&quot; + content.gameID);
          stompClient.subscribe('/topic/' + content.gameID, function (greeting) {
                     showGreeting(JSON.parse(greeting.body).content);
                 });
   })();
  }
  </code></pre>
  <p>Java code:</p>
  <pre><code>@RestController
  @RequestMapping(&quot;/game&quot;)
  public class DrinkOrDiceController {
  
      Logger LOG = LoggerFactory.getLogger(DrinkOrDiceController.class);
  
      @Autowired
      DrinkOrDiceService drinkOrDiceService;
  
      public DrinkOrDiceController(){
  
      }
  
      @PostMapping(&quot;/newgame&quot;)
      public ResponseEntity&lt;String&gt; startNewGame(@RequestBody String playername) throws Exception {
          LOG.info(&quot;Request to make a new game by {}&quot;, playername);
          return ResponseEntity.ok((drinkOrDiceService.createGame(playername)));
      }
  
      @PostMapping(&quot;/joinrandom&quot;)
      public ResponseEntity&lt;Game&gt; joinRandomGame(@RequestBody String playername) throws Exception {
          LOG.info(&quot;Request to join a random game by {}&quot;, playername);
          return ResponseEntity.ok((drinkOrDiceService.joinRandomGame(playername)));
      }
  </code></pre>
  <p>The output I get from console.log() on the frontend:
  <a href="https://i.stack.imgur.com/JGSxd.png" rel="nofollow noreferrer">console.log() frontend</a></p>