PHP Classes

File: jwtclient_example.php

Recommend this page to a friend!
  Classes of andy honeycutt  >  PHP JWT Library API Base  >  jwtclient_example.php  >  Download  
File: jwtclient_example.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP JWT Library API Base
Send authenticated API requests using JWT
Author: By
Last change:
Date: 5 years ago
Size: 584 bytes


Class file image Download

$url = '';
$username = 'myUsername';
$password = 'myPassword';

$client = new JWTApiBase($url, $username, $password);

// Perhaps we want to update the email address of user at 1234
$data = json_encode(array(
'id' => '1234',
'email_address' => ''

// append the endpoint "user/" to our client base url, send our data to it
$response = $client->apiRequest($data, $client->getUrl('user/'));

// print out the repsonse

For more information send a message to info at phpclasses dot org.