## Index

### Classes

- BaseService
- ServiceParameter

### Interfaces

- IApiResponse
- IHttpHeaders
- IMethodOptions

### Type aliases

- RestAttr
- RestMethodAttr
- RestParamAttr

### Variables

- Body
- BodyFormModel
- Delete
- Get
- Header
- Patch
- Path
- Post
- Put
- Query
- RawBody
- XmlBody

### Functions

- BaseUrl
- Cancel

## Type aliases

### RestAttr

RestAttr: function

- Defined in services/http/RestService.ts:123

#### Type declaration

- - (target: BaseService, propertyKey: string | symbol, parameterIndex: number): void

  - #### Parameters

    - ##### target: BaseService

    - ##### propertyKey: string | symbol

    - ##### parameterIndex: number

    #### Returns void

### RestMethodAttr

RestMethodAttr: function

- Defined in services/http/RestService.ts:130

#### Type declaration

- - (key: string, options?: IMethodOptions): function

  - #### Parameters

    - ##### key: string

    - ##### Optional options: IMethodOptions

    #### Returns function

    - - (target: BaseService, propertyKey: string | symbol, descriptor: any): void

      - #### Parameters

        - ##### target: BaseService

        - ##### propertyKey: string | symbol

        - ##### descriptor: any

        #### Returns void

### RestParamAttr

RestParamAttr: function

- Defined in services/http/RestService.ts:127

#### Type declaration

- - (key: string, defaultValue?: any): RestAttr

  - #### Parameters

    - ##### key: string

    - ##### Optional defaultValue: any

    #### Returns RestAttr

## Variables

### Const Body

Body: RestAttr = parameterBuilder("Body")("")

- Defined in services/http/RestService.ts:200

This will register data fragment on ajax.

example

       @Post("/api/products")
       async getProducts(
           @Query("id")  id: number,
           @Body product: Product
       ): Promise<Product[]> {
       }

export
function

  Body

### Const BodyFormModel

BodyFormModel: RestAttr = parameterBuilder("BodyFormModel")("")

- Defined in services/http/RestService.ts:219

This will register data fragment on ajax in old formModel way.

example

       @Post("/api/products")
       async getProducts(
           @Query("id")  id: number,
           @BodyFormModel product: Product
       ): Promise<Product[]> {
       }

export
function

  BodyFormModel

### Const Delete

Delete: RestMethodAttr = methodBuilder("Delete")

- Defined in services/http/RestService.ts:269

Http Delete method

example

       @Delete("/api/products")
       async deleteProduct(
           @Body product: Product
       ): Promise<Product> {
       }

export
function

  Delete

param

  Url for the operation

### Const Get

Get: RestMethodAttr = methodBuilder("Get")

- Defined in services/http/RestService.ts:253

Http Get Method

example

       @Get("/api/products/{category}")
       async getProducts(
           @Path("category") category?:string
       ): Promise<Product[]> {
       }

export
function

  Body

### Const Header

Header: RestParamAttr = parameterBuilder("Header")

- Defined in services/http/RestService.ts:166

This will register header on parameter.

example

       @Get("/api/products/{category}")
       async getProducts(
           @Header("x-http-auth")  category: number
       ): Promise<Product[]> {
       }

export
function

  Path

param

  Name of the parameter

### Const Patch

Patch: RestMethodAttr = methodBuilder("Patch")

- Defined in services/http/RestService.ts:301

Http Patch method

example

       @Patch("/api/products")
       async saveProduct(
           @Body product: any
       ): Promise<Product> {
       }

export
function

  Patch

param

  Url for the operation

### Const Path

Path: RestParamAttr = parameterBuilder("Path")

- Defined in services/http/RestService.ts:149

This will register Url path fragment on parameter.

example

       @Get("/api/products/{category}")
       async getProducts(
           @Path("category")  category: number
       ): Promise<Product[]> {
       }

export
function

  Path

param

  Name of the parameter

### Const Post

Post: RestMethodAttr = methodBuilder("Post")

- Defined in services/http/RestService.ts:237

Http Post method

example

       @Post("/api/products")
       async saveProduct(
           @Body product: Product
       ): Promise<Product> {
       }

export
function

  Post

param

  Url for the operation

### Const Put

Put: RestMethodAttr = methodBuilder("Put")

- Defined in services/http/RestService.ts:285

Http Put method

example

       @Put("/api/products")
       async saveProduct(
           @Body product: Product
       ): Promise<Product> {
       }

export
function

  Put

param

  Url for the operation

### Const Query

Query: RestParamAttr = parameterBuilder("Query")

- Defined in services/http/RestService.ts:183

This will register Url query fragment on parameter.

example

       @Get("/api/products")
       async getProducts(
           @Query("category")  category: number
       ): Promise<Product[]> {
       }

export
function

  Query

param

  Name of the parameter

### Const RawBody

RawBody: RestAttr = parameterBuilder("RawBody")("")

- Defined in services/http/RestService.ts:202

### Const XmlBody

XmlBody: RestAttr = parameterBuilder("XmlBody")("")

- Defined in services/http/RestService.ts:221

## Functions

### BaseUrl

- BaseUrl(baseUrl: string): function

- - Defined in services/http/RestService.ts:342

  #### Parameters

  - ##### baseUrl: string

  #### Returns function

  - - (target: any): void

    - #### Parameters

      - ##### target: any

      #### Returns void

### Cancel

- Cancel(target: BaseService, propertyKey: string | symbol, parameterIndex: number): void

- - Defined in services/http/RestService.ts:318

  Cancellation token

  example

         @Put("/api/products")
         async saveProduct(
             @Body product: Product
             @Cancel cancel: CancelToken
         ): Promise<Product> {
         }

  export
  function

    Put

  #### Parameters

  - ##### target: BaseService

  - ##### propertyKey: string | symbol

  - ##### parameterIndex: number

  #### Returns void

Generated using TypeDoc