You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-11Lines changed: 18 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,8 @@ This library is inspired by the HTTP interface in Spring 6 and provides a simila
14
14
15
15
- Provides a simplified and declarative way of creating HTTP services.
16
16
- Provides a concise syntax for handling query parameters, path variables, request headers, request bodies, and forms.
17
-
- Offers integration with [class-transformer](https://github.com/typestack/class-transformer) to facilitate data transformation.
17
+
- Offers integration with [class-transformer](https://github.com/typestack/class-transformer) to facilitate data
18
+
transformation.
18
19
- Uses promises instead of observables
19
20
20
21
## Requirements
@@ -77,22 +78,28 @@ export class AppModule {
77
78
## Decorators
78
79
79
80
-`@HttpInterface()`: Marks the class as an HTTP service.
80
-
81
-
-`@{HTTP Method}Exchange(path: string)`: Marks the method as an HTTP request method, with `path` being the request's path or full URL.
82
-
83
-
-`@ResponseBody(dto: ClassConstructor, options?: ClassTransformOptions)`: Specifies the response DTO using a class constructor and options from the `class-transformer` library.
84
-
81
+
82
+
-`@{HTTP Method}Exchange(path: string)`: Marks the method as an HTTP request method, with `path` being the request's
83
+
path or full URL.
84
+
85
+
-`@ResponseBody(dto: ClassConstructor, options?: ClassTransformOptions)`: Specifies the response DTO using a class
86
+
constructor and options from the `class-transformer` library.
87
+
85
88
-`@PathVariable(name?: string)`: Specifies the path variable, requiring the name of the variable.
86
-
87
-
-`@RequestParam(key?: string)`: Specifies the query string parameter, requiring the key of the parameter. If `key` is not specified, the parameter must be an object. See examples below:
89
+
90
+
-`@RequestParam(key?: string, defaultValue?: string)`: Specifies the query string parameter, requiring the key of the
91
+
parameter. If `key` is not specified, the parameter must be an object. See examples below:
88
92
- Example with key: `request(@RequestParam('foo') query: string): string`
89
93
- Example without key: `request(@RequestParam() query: { foo: string }): string`
90
94
91
-
-`@RequestHeader(key?: string)`: Specifies the request header, requiring the key of the header optionally.
95
+
-`@RequestHeader(key?: string, defaultValue?: string)`: Specifies the request header, requiring the key of the header
96
+
optionally.
92
97
93
-
-`@RequestBody(key?: string)`: Specifies the request body using `application/json` as the content type, requiring the key of the body optionally.
98
+
-`@RequestBody(key?: string, defalutValue?: unkown)`: Specifies the request body using `application/json` as the
99
+
content type, requiring the key of the body optionally.
94
100
95
-
-`@RequestForm(key?: string)`: Specifies the request form using `application/x-www-form-urlencoded` as the content type, requiring the key of the body optionally.
101
+
-`@RequestForm(key?: string, defaultValue?: string)`: Specifies the request form
102
+
using `application/x-www-form-urlencoded` as the content type, requiring the key of the body optionally.
0 commit comments