Jump to content

What do you use when work with remote API?


Recommended Posts

Posted

I'm planning to start a project where remote API will be involved and thinking about tools to work with API. Of course, we have WireHttp class and actually, I think to go with it, but maybe there are more specialized alternatives that worth to consider?

Posted
3 hours ago, Guy Verville said:

Thank you. It is interesting. As we don't know if we will host the two sites, it can be tricky to get there. But I will give it a try!

Of course - that is a good reason to not use it. It was on Ryan's roadmap to allow it to work over http, but not sure when/if that will happen.

  • Like 1
Posted

@adrian, @Guy Verville Thanks for your inputs. I tested WireHttp a little today and I must say that it's quite convenient, so I will use it. The beauty of PW, one tool for almost all tasks. 

$clantag = "test";
$token = "---";
$url = "https://site.com/" . urlencode($clantag);

$http = new WireHttp();
$http->setValidateURLOptions([
    'convertEncoded' => false,
    'encodeSpace' => true
]);
$http->setHeaders([
    'Accept' => "application/json",
    'Authorization' => "Bearer " . $token
]);

$response = $http->getJSON($url);
d($response);

 

  • Like 5
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...