title: Send post request with bearer token and json body in Swift
body: <p>I'm pretty new to swift and i tried to make a post request to a website, but couldn't come up with an working result, yet. All examples I found didn't work for me either.</p>
  
  <p>I need to send a json body to <em><a href="https://mypostrequestdestination.com/api/" rel="noreferrer">https://mypostrequestdestination.com/api/</a></em></p>
  
  <p>The json body only contains of one value</p>
  
  <pre><code>{State:1}
  </code></pre>
  
  <p>And the Header has to contain</p>
  
  <pre><code>{"Authorization": bearer "token"}
  
  {"Accept":"application/json"}
  
  {"Content-Type":"application/json"}
  </code></pre>
  
  <p>Hope someone can help me.</p>
  
  <p>Thanks!</p>