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
Example
;; ;;
API Docs
RESTClient
Methods:
getBaseUrl(): string
: returns the base url of RESTClientgetDefaultHeaders(): 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
License
MIT