@nativecode/rest-client
REST client
Last updated 8 months ago by teegee .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install @nativecode/rest-client 
SYNC missed versions from official npm registry.

@nativecode/rest-client

Provides an abstract REST compatible resource class using isomorphic-fetch to perform operations.

Install

npm install @nativecode/rest-client

Usage

import { Resource } from '@nativecode/rest-client'

export class RestResource extends Resource {
  constructor(endpoint: URL, apikey: string, logger: Lincoln) {
    super(endpoint, logger)
    this.setHeader('x-api-key', apikey)
  }

  all(): Promise<Model[]> {
    return this.http_get('models')
  }

  byId(id: number): Promise<Model> {
    return this.http_get('models/{:id}', [
      {
        key: 'id',
        type: RestResourceParamType.RouteParameter,
        value: id,
      }
    ])
  }
}

Current Tags

  • 0.0.2-canary.137                                ...           canary (a year ago)
  • 3.0.0                                ...           latest (6 months ago)
  • 3.0.0-next.3                                ...           next (6 months ago)

53 Versions

  • 3.0.0                                ...           6 months ago
  • 3.0.0-next.3                                ...           6 months ago
  • 3.0.0-next.2                                ...           6 months ago
  • 3.0.0-next.1                                ...           6 months ago
  • 3.0.0-next.0                                ...           6 months ago
  • 2.5.0-next.3                                ...           7 months ago
  • 2.5.0-next.2                                ...           7 months ago
  • 2.5.0-next.1                                ...           7 months ago
  • 2.5.0-next.0                                ...           7 months ago
  • 2.4.1                                ...           7 months ago
  • 2.4.1-next.1                                ...           7 months ago
  • 2.4.1-next.0                                ...           7 months ago
  • 2.4.0                                ...           7 months ago
  • 2.3.0                                ...           7 months ago
  • 2.3.0-next.0                                ...           7 months ago
  • 2.2.3-next.1                                ...           8 months ago
  • 2.2.3-next.0                                ...           8 months ago
  • 2.2.2                                ...           8 months ago
  • 2.2.1-next.1                                ...           8 months ago
  • 2.2.1-next.0                                ...           8 months ago
  • 2.2.1                                ...           8 months ago
  • 2.2.0                                ...           8 months ago
  • 2.2.0-next.0                                ...           8 months ago
  • 2.1.0                                ...           8 months ago
  • 2.1.0-next.0                                ...           8 months ago
  • 2.0.1                                ...           8 months ago
  • 2.0.1-next.0                                ...           8 months ago
  • 2.0.0                                ...           8 months ago
  • 2.0.0-next.3                                ...           8 months ago
  • 2.0.0-next.2                                ...           8 months ago
  • 2.0.0-next.1                                ...           8 months ago
  • 2.0.0-next.0                                ...           8 months ago
  • 1.1.1                                ...           8 months ago
  • 1.1.1-next.2                                ...           8 months ago
  • 1.1.1-next.1                                ...           8 months ago
  • 1.1.1-next.0                                ...           8 months ago
  • 1.1.0                                ...           8 months ago
  • 1.1.0-next.2                                ...           8 months ago
  • 1.1.0-next.1                                ...           8 months ago
  • 1.1.0-next.0                                ...           8 months ago
  • 1.0.1                                ...           8 months ago
  • 1.0.1-next.1                                ...           8 months ago
  • 1.0.0-next.1                                ...           a year ago
  • 1.0.0-next.0                                ...           a year ago
  • 0.0.2-canary.137                                ...           a year ago
  • 0.0.2-canary.131                                ...           a year ago
  • 0.0.2-alpha.111                                ...           a year ago
  • 0.0.2-alpha.110                                ...           a year ago
  • 0.0.1                                ...           a year ago
  • 0.0.2-alpha.11                                ...           a year ago
  • 0.0.2-next.97                                ...           a year ago
  • 0.0.2-next.93                                ...           a year ago
  • 0.0.1-alpha.50                                ...           a year ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (5)

Copyright 2014 - 2016 © taobao.org |