angular2-rest

Angular2 HTTP client to consume RESTful services. Built with TypeScript.
2 people use it
Author: 3684864?v=3 Paldom
Submitted by: 3684864?v=3 Paldom

angular2-rest

Angular2 HTTP client to consume RESTful services. Built on angular2/http with TypeScript.
Note: this solutions is not production ready, it's in a very basic alpha state. Any ideas or contributions are very welcomed :)

Installation

npm install angular2-rest

API Docs

RESTClient

Methods:

  • getBaseUrl(): string: returns the base url of RESTClient
  • getDefaultHeaders(): Object: returns the default headers of RESTClient in a key-value pair

Class decorators:

  • @BaseUrl(url: string)
  • @DefaultHeaders(headers: Object)

Method decorators:

  • @GET(url: String)
  • @POST(url: String)
  • @PUT(url: String)
  • @DELETE(url: String)
  • @Headers(headers: Object)

Parameter decorators:

  • @Path(key: string)
  • @Query(key: string)
  • @Header(key: string)
  • @Body

IRequest

Properties:

  • url: string;: resource url
  • headers: Headers;: angular/http Headers
  • body?: Object;: optional, body Object

IResponse

TODO

License

MIT

comments powered by Disqus
This page was last updated over 1 year ago.