title: JS Fetch api PUT method on multi-level json
body: <p>Here's the json: <a href="https://api.myjson.com/bins/mpyk8" rel="nofollow noreferrer">https://api.myjson.com/bins/mpyk8</a>
  It's multilevel (as in there are objects within objects).</p>
  
  <p>Getting the data from the json to my React Native app was easy, but I can't figure out how to update the json. (myjson, according to their docs, allows you to do so)</p>
  
  <p>Now, I'm using js Fetch api, and wrote up this:</p>
  
  <pre><code>updatejson(){
    fetch("https://api.myjson.com/bins/1b8i38/", {
      method: 'PUT',
      body: JSON.stringify({"location":"somevalue"}),
      contentType:"application/json; charset=utf-8",
      dataType:"json",
      })
    .then((response) =&gt; {
      response.json().then((response) =&gt; {
        console.log(response);
      })
    }).catch(err =&gt; {
      console.error(err)
    })}
  </code></pre>
  
  <p><strong>How do I update an object within an object?</strong> What should the body property look like? Is there some other trick to it?</p>
  
  <p>Happy to explain the problem further, if I was unclear. Thanks in advance!</p>