="external-link">toJSON</a></span><span class="op">(</span><span class="va">body</span>, auto_unbox <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span>,</span>
<span>    encode <span class="op">=</span> <span class="st">"json"</span></span>
<span>  <span class="op">)</span></span>
<span></span>
<span>  <span class="co"># Check for HTTP errors</span></span>
<span>  <span class="fu">httr</span><span class="fu">::</span><span class="fu"><a href="https://httr.r-lib.org/reference/stop