Skip to content

Commit ee00fad

Browse files
jbl428imdudu1
andcommitted
docs: update README.md
Co-authored-by: imdudu1 <[email protected]>
1 parent c5b06ff commit ee00fad

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

README.md

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ This library is inspired by the HTTP interface in Spring 6 and provides a simila
1414

1515
- Provides a simplified and declarative way of creating HTTP services.
1616
- 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.
1819
- Uses promises instead of observables
1920

2021
## Requirements
@@ -77,22 +78,28 @@ export class AppModule {
7778
## Decorators
7879

7980
- `@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+
8588
- `@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:
8892
- Example with key: `request(@RequestParam('foo') query: string): string`
8993
- Example without key: `request(@RequestParam() query: { foo: string }): string`
9094

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.
9297

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.
94100

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.
96103

97104
## License
98105

0 commit comments

Comments
 (0)