Exemple #1
0
 public function get_token_details($access_token)
 {
     $url = $this->base_url . "/auth/oauth2/access_token_info?access_token=" . $access_token;
     Lingotek::log("GET " . $url . " (" . __METHOD__ . ")");
     $response = wp_remote_get($url);
     $response_code = wp_remote_retrieve_response_code($response);
     if ($response_code == 200) {
         $response_body = json_decode(wp_remote_retrieve_body($response));
         $token_details = $response_body;
     } else {
         $token_details = FALSE;
     }
     return $token_details;
 }
 public function patch($url, $args = array())
 {
     Lingotek::log("PATCH " . $url);
     if (!empty($args)) {
         Lingotek::log($args);
     }
     return wp_remote_request($url, array('method' => 'PATCH', 'headers' => $this->headers, 'body' => $args));
 }