src/wireclient.js
function (method, uri, token, headers, body, getEtag, fakeRevision) {
    if ((method === 'PUT' || method === 'DELETE') && uri[uri.length - 1] === '/') {
      return Promise.reject('Don\'t ' + method + ' on directories!');
    }

    var revision;
    var self = this;

    if (token !== Authorize.IMPLIED_FAKE_TOKEN) {
      headers['Authorization'] = 'Bearer ' + token;
    }

    this.rs._emit('wire-busy', {
      method: method,
      isFolder: isFolder(uri)
    });

    return WireClient.request(method, uri, {
      body: body,
      headers: headers,
      responseType: 'arraybuffer'
    }).then(function(response) {
      if (!self.online) {
        self.online = true;
        self.rs._emit('network-online');
      }
      self.rs._emit('wire-done', {
        method: method,
        isFolder: isFolder(uri),
        success: true
      });

      if (isErrorStatus(response.status)) {
        log('[WireClient] Error response status', response.status);
        if (getEtag) {
          revision = stripQuotes(response.getResponseHeader('ETag'));
        } else {
          revision = undefined;
        }

        if (response.status === 401) {
          self.rs._emit('error', new Authorize.Unauthorized());
        }

        return Promise.resolve({statusCode: response.status, revision: revision});
      } else if (isSuccessStatus(response.status) ||
                 (response.status === 200 && method !== 'GET')) {
        revision = stripQuotes(response.getResponseHeader('ETag'));
        log('[WireClient] Successful request', revision);
        return Promise.resolve({statusCode: response.status, revision: revision});
      } else {
        var mimeType = response.getResponseHeader('Content-Type');
        if (getEtag) {
          revision = stripQuotes(response.getResponseHeader('ETag'));
        } else {
          revision = response.status === 200 ? fakeRevision : undefined;
        }

        var charset = determineCharset(mimeType);

        if (shouldBeTreatedAsBinary(response.response, mimeType)) {
          log('[WireClient] Successful request with unknown or binary mime-type', revision);
          return Promise.resolve({
            statusCode: response.status,
            body: response.response,
            contentType: mimeType,
            revision: revision
          });
        } else {
          return getTextFromArrayBuffer(response.response, charset)
            .then(function (textContent) {
              log('[WireClient] Successful request', revision);
              return Promise.resolve({
                statusCode: response.status,
                body: textContent,
                contentType: mimeType,
                revision: revision
              });
            });
        }
      }
    }, function (error) {
      if (self.online) {
        self.online = false;
        self.rs._emit('network-offline');
      }
      self.rs._emit('wire-done', {
        method: method,
        isFolder: isFolder(uri),
        success: false
      });

      return Promise.reject(error);
    });
  }
function (method, uri, token, headers, body, getEtag, fakeRevision) {
    if ((method === 'PUT' || method === 'DELETE') && uri[uri.length - 1] === '/') {
      return Promise.reject('Don\'t ' + method + ' on directories!');
    }

    var revision;
    var self = this;

    if (token !== Authorize.IMPLIED_FAKE_TOKEN) {
      headers['Authorization'] = 'Bearer ' + token;
    }

    this.rs._emit('wire-busy', {
      method: method,
      isFolder: isFolder(uri)
    });

    return WireClient.request(method, uri, {
      body: body,
      headers: headers,
      responseType: 'arraybuffer'
    }).then(function(response) {
      if (!self.online) {
        self.online = true;
        self.rs._emit('network-online');
      }
      self.rs._emit('wire-done', {
        method: method,
        isFolder: isFolder(uri),
        success: true
      });

      if (isErrorStatus(response.status)) {
        log('[WireClient] Error response status', response.status);
        if (getEtag) {
          revision = stripQuotes(response.getResponseHeader('ETag'));
        } else {
          revision = undefined;
        }

        if (response.status === 401) {
          self.rs._emit('error', new Authorize.Unauthorized());
        }

        return Promise.resolve({statusCode: response.status, revision: revision});
      } else if (isSuccessStatus(response.status) ||
                 (response.status === 200 && method !== 'GET')) {
        revision = stripQuotes(response.getResponseHeader('ETag'));
        log('[WireClient] Successful request', revision);
        return Promise.resolve({statusCode: response.status, revision: revision});
      } else {
        var mimeType = response.getResponseHeader('Content-Type');
        if (getEtag) {
          revision = stripQuotes(response.getResponseHeader('ETag'));
        } else {
          revision = response.status === 200 ? fakeRevision : undefined;
        }

        var charset = determineCharset(mimeType);

        if (shouldBeTreatedAsBinary(response.response, mimeType)) {
          log('[WireClient] Successful request with unknown or binary mime-type', revision);
          return Promise.resolve({
            statusCode: response.status,
            body: response.response,
            contentType: mimeType,
            revision: revision
          });
        } else {
          return getTextFromArrayBuffer(response.response, charset)
            .then(function (textContent) {
              log('[WireClient] Successful request', revision);
              return Promise.resolve({
                statusCode: response.status,
                body: textContent,
                contentType: mimeType,
                revision: revision
              });
            });
        }
      }
    }, function (error) {
      if (self.online) {
        self.online = false;
        self.rs._emit('network-offline');
      }
      self.rs._emit('wire-done', {
        method: method,
        isFolder: isFolder(uri),
        success: false
      });

      return Promise.reject(error);
    });
  }
function ( method , uri , token , headers , body , getEtag , fakeRevision ) { if ( ( method === 'PUT' || method === 'DELETE' ) && uri [ uri . length - 1 ] === '/' ) { return Promise . reject ( 'Don\'t ' + method + ' on directories!' ) ; } var revision ; var self = this ; if ( token !== Authorize . IMPLIED_FAKE_TOKEN ) { headers [ 'Authorization' ] = 'Bearer ' + token ; } this . rs . _emit ( 'wire-busy' , { method : method , isFolder : isFolder ( uri ) } ) ; return WireClient . request ( method , uri , { body : body , headers : headers , responseType : 'arraybuffer' } ) . then ( function ( response ) { if ( ! self . online ) { self . online = true ; self . rs . _emit ( 'network-online' ) ; } self . rs . _emit ( 'wire-done' , { method : method , isFolder : isFolder ( uri ) , success : true } ) ; if ( isErrorStatus ( response . status ) ) { log ( '[WireClient] Error response status' , response . status ) ; if ( getEtag ) { revision = stripQuotes ( response . getResponseHeader ( 'ETag' ) ) ; } else { revision = undefined ; } if ( response . status === 401 ) { self . rs . _emit ( 'error' , new Authorize . Unauthorized ( ) ) ; } return Promise . resolve ( { statusCode : response . status , revision : revision } ) ; } else if ( isSuccessStatus ( response . status ) || ( response . status === 200 && method !== 'GET' ) ) { revision = stripQuotes ( response . getResponseHeader ( 'ETag' ) ) ; log ( '[WireClient] Successful request' , revision ) ; return Promise . resolve ( { statusCode : response . status , revision : revision } ) ; } else { var mimeType = response . getResponseHeader ( 'Content-Type' ) ; if ( getEtag ) { revision = stripQuotes ( response . getResponseHeader ( 'ETag' ) ) ; } else { revision = response . status === 200 ? fakeRevision : undefined ; } var charset = determineCharset ( mimeType ) ; if ( shouldBeTreatedAsBinary ( response . response , mimeType ) ) { log ( '[WireClient] Successful request with unknown or binary mime-type' , revision ) ; return Promise . resolve ( { statusCode : response . status , body : response . response , contentType : mimeType , revision : revision } ) ; } else { return getTextFromArrayBuffer ( response . response , charset ) . then ( function ( textContent ) { log ( '[WireClient] Successful request' , revision ) ; return Promise . resolve ( { statusCode : response . status , body : textContent , contentType : mimeType , revision : revision } ) ; } ) ; } } } , function ( error ) { if ( self . online ) { self . online = false ; self . rs . _emit ( 'network-offline' ) ; } self . rs . _emit ( 'wire-done' , { method : method , isFolder : isFolder ( uri ) , success : false } ) ; return Promise . reject ( error ) ; } ) ; }
Property: href

Holds the server's base URL, as obtained in the Webfinger discovery

Example:
(start code)

remoteStorage.remote.href
// -> 'https://storage.example.com/users/jblogg/'
 
Property: storageApi

Holds the spec version the server claims to be compatible with

Example:
(start code)

remoteStorage.remote.storageApi
// -> 'draft-dejong-remotestorage-01'
Property : href