## Index

### Classes

- BaseService
- ServiceParameter

### Interfaces

- IApiResponse
- IHttpHeaders
- IMethodOptions

### Type aliases

- RestAttr
- RestMethodAttr
- RestParamAttr

### Variables

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

### Functions

- BaseUrl
- Cancel

## Type aliases

### RestAttr

RestAttr: function

- Defined in src/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 src/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 src/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 src/services/http/RestService.ts:214

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 src/services/http/RestService.ts:233

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 src/services/http/RestService.ts:283

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 src/services/http/RestService.ts:267

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 src/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 src/services/http/RestService.ts:315

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 src/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 src/services/http/RestService.ts:251

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 src/services/http/RestService.ts:299

Http Put method

example

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

export
function

  Put

param

  Url for the operation

### Const Queries

Queries: RestAttr = parameterBuilder("Queries")("")

- Defined in src/services/http/RestService.ts:197

This will register Url query fragments on parameter of type object

example

      @Get("/api/products")
      async getProducts(
           @Queries queries: { [key: string]: string | number | boolean | null }
      ): Promise<Product[]> {
          return null;

  }

### Const Query

Query: RestParamAttr = parameterBuilder("Query")

- Defined in src/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 src/services/http/RestService.ts:216

### Const XmlBody

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

- Defined in src/services/http/RestService.ts:235

## Functions

### BaseUrl

- BaseUrl(baseUrl: string): function

- - Defined in src/services/http/RestService.ts:356

  #### 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 src/services/http/RestService.ts:332

  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