Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
nestjs-http-manager
Advanced tools
Обертка над http-модулем с использованием реактивного программирования и отловом ошибок для nestjs
yarn add nestjs-http-manager
// или
npm i nestjs-http-manager
Для использования данной библиотеки в своем проекте, необходимо:
@Module({
imports: [
..., HttpManagerModule, ...
],
controllers: [...],
providers: [...],
})
constructor(private readonly httpManager: HttpManagerService) {}
Готово! Сервис может использоваться
GET-запрос
...
const res: YourType = await this.httpManager.get<YourType>(
'http://example.com', {headers: {'Authorization': 'Bearer ...'}}
)
...
Аналогично и для POST-запроса
...
const res: YourType = await this.httpManager.post<YourType>(
'http://example.com', {
data: {key: value},
headers: {'Authorization': 'Bearer ...'}
})
...
Можно также не передавать options и оставить только url
FAQs
Обертка над http-модулем с использованием реактивного программирования и отловом ошибок для nestjs
We found that nestjs-http-manager demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.