<div dir="ltr">Group,<div><br></div><div><br></div><div>Is there a downside to casting responses from a rest response into a json object rather than a generic $var? Here is my function it works but I want to be aware if this will cost a considerable amount of resources.</div><div><br></div><div>







<p class=""><span class="">                      if (!rest_get(&quot;http:</span><span class="">//<a href="http://myauthurl.com/authme/$fU/$rU">myauthurl.com/authme/$fU/$rU</a>&quot;, &quot;$json(authresponse)&quot;, &quot;$var(ct)&quot;, &quot;$var(rcode)&quot;)) {</span></p>
<p class=""><span class=""></span><br></p>
<p class=""><span class="">        xlog(&quot;Error code $var(rcode) in HTTP GET!\n&quot;)</span><span class="">;</span></p>
<p class=""><span class="">xlog(&quot;on account of admittance error we are sending the call to the AS server for processing&quot;)</span><span class="">;</span><br><span class=""></span></p>
<p class=""><span class="">        route(4)</span><span class="">;</span></p>
<p class=""><span class="">}</span></p>
<p class=""><span class=""></span><br></p>
<p class=""><span class="">                xlog(&quot;got this body response from authority on invite $json(authresponse) with response code $var(rcode)&quot;)</span><span class="">;</span></p>
<p class=""><span class="">        xlog(&quot;response now casting to json  $json(authresponse) &quot;)</span><span class="">;</span></p>
<p class=""><span class="">        $json(authbody) :=</span><span class=""> &quot;{}&quot;</span><span class="">;</span></p>
<p class=""><span class=""></span><br></p>
<p class=""><span class="">        $json(authbody) :=</span><span class=""> $json(authresponse)</span><span class="">;</span></p>
<p class=""><span class="">        xlog(&quot; accessing the message $json(authbody/message)&quot;)</span><span class="">;</span></p>
<p class=""><span class=""></span><br></p>
<p class=""><span class="">        $json(accept) :=</span><span class="">  $json(authbody/message)</span><span class="">;</span><br></p>
<p class=""><span class="">        xlog(&quot; casted message $json(accept)&quot;)</span><span class="">;</span></p>
<p class=""><span class="">        if($json(accept/AcceptCall) =</span><span class="">= &quot;false&quot;){         </span><br></p>
<p class=""><span class="">        xlog(&quot;response equal false&quot;)</span><span class="">;</span></p>
<p class=""><span class="">                                                                route(3)</span><span class="">;</span></p>
<p class=""><span class=""></span><br></p>
<p class=""><span class=""></span><br></p>
<p class=""><span class="">        }else{</span></p><p class=""><span class=""><br></span></p><p class=""><span class=""><br></span></p><p class=""><span class="">Notice how the response is casted from </span><span class="">$json(authresponse) to </span> $json(authbody)  after it is initialized. I came to realize that I had to initialize a variable because I couldn&#39;t access keys in <span class=""> </span><span class="">$json(authresponse).</span></p><p class=""><span class=""><br></span></p><p class=""><span class=""><br></span></p><p class=""><span class="">Thanks,</span></p><p class=""><span class="">Tito</span></p></div></div>