Skip to the content
Documentation

Using the JavaScript REST API Client: comparison of v.8 v...

No ratings yet

Versions Compared

Old Version 8

changes.mady.by.user Dominika Kurek

Saved on Jan 15, 2016

compared with

New Version Current

changes.mady.by.user Philippe Vincent-Royol

Saved on Feb 08, 2016

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
language js
theme Midnight
title Basic Authentication
var capi,
    credentials = {
        login: 'admin',
        password: 'publish',
    };

capi = new eZ.CAPI(
    'http://example.com',
    new eZ.BasicAuthAgentHttpBasicAuthAgent(credentials)
);
capi.logIn(function (error, response) {
    if ( error ) {
        console.log('Error!');
        return;
    }
    console.log("The credentials are valid");
});

...

Comments

Add a comment

Comments are read by a moderator before they appear.