{"id":13392532,"url":"https://github.com/Microsoft/typed-rest-client","last_synced_at":"2025-03-13T18:31:50.743Z","repository":{"id":15599767,"uuid":"78447447","full_name":"microsoft/typed-rest-client","owner":"microsoft","description":"Node Rest and Http Clients with typings for use with TypeScript","archived":false,"fork":false,"pushed_at":"2025-02-03T03:09:14.000Z","size":1291,"stargazers_count":676,"open_issues_count":21,"forks_count":116,"subscribers_count":40,"default_branch":"master","last_synced_at":"2025-03-11T21:03:53.636Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microsoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-09T16:35:28.000Z","updated_at":"2025-02-13T19:04:20.000Z","dependencies_parsed_at":"2024-03-07T11:44:01.391Z","dependency_job_id":"6db8353a-c1dc-4962-a82a-20bcf3b9b142","html_url":"https://github.com/microsoft/typed-rest-client","commit_stats":{"total_commits":213,"total_committers":55,"mean_commits":"3.8727272727272726","dds":0.7230046948356808,"last_synced_commit":"92f407b74bb80dba0de725628d65aa22d0dae57b"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Ftyped-rest-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Ftyped-rest-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Ftyped-rest-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Ftyped-rest-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microsoft","download_url":"https://codeload.github.com/microsoft/typed-rest-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243112147,"owners_count":20238185,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T17:00:26.863Z","updated_at":"2025-03-13T18:31:50.701Z","avatar_url":"https://github.com/microsoft.png","language":"TypeScript","readme":"\n[![Build Status](https://dev.azure.com/ms/typed-rest-client/_apis/build/status/Microsoft.typed-rest-client?branchName=master)](https://dev.azure.com/ms/typed-rest-client/_build/latest?definitionId=42\u0026branchName=master)\n\n\n# Typed REST and HTTP Client with TypeScript Typings\n\nA lightweight REST and HTTP client optimized for use with TypeScript with generics and async await.\n\n## Features\n\n  - REST and HTTP client with TypeScript generics and async/await/Promises\n  - Typings included so no need to acquire separately (great for intellisense and no versioning drift)\n  - Basic, Bearer and NTLM Support out of the box.  Extensible handlers for others.\n  - Proxy support\n  - Certificate support (Self-signed server and client cert)\n  - Redirects supported\n\nIntellisense and compile support:\n\n![intellisense](./docs/intellisense.png)\n\n## Install\n\n```\nnpm install typed-rest-client --save\n```\n\nOr to install the latest preview:\n```\nnpm install typed-rest-client@preview --save\n```\n\n## Samples\n\nSee the [samples](./samples) for complete coding examples. Also see the [REST](./test/tests/resttests.ts) and [HTTP](./test/tests/httptests.ts) tests for detailed examples.\n\n## Errors\n\n### HTTP\n\nThe HTTP client does not throw unless truly exceptional.\n\n* A request that successfully executes resulting in a 404, 500 etc... will return a response object with a status code and a body.\n* Redirects (3xx) will be followed by default.\n\n\nSee [HTTP tests](./test/tests/httptests.ts) for detailed examples.\n\n### REST\n\nThe REST client is a high-level client which uses the HTTP client.  Its responsibility is to turn a body into a typed resource object.  \n\n* A 200 will be success.  \n* Redirects (3xx) will be followed.  \n* A 404 will not throw but the result object will be null and the result statusCode will be set.\n* Other 4xx and 5xx errors will throw.  The status code will be attached to the error object.  If a RESTful error object is returned (`{ message: xxx}`), then the error message will be that.  Otherwise, it will be a generic, `Failed Request: (xxx)`.\n\nSee [REST tests](./test/tests/resttests.ts) for detailed examples.\n\n## Debugging\n\nTo enable detailed console logging of all HTTP requests and responses, set the NODE_DEBUG environment varible:\n\n```\nexport NODE_DEBUG=http\n```\n\nor\n\n```\nset NODE_DEBUG=http\n```\n\n## Node support\n\nv2 - [current, maintained] - Supports node 16 and above\nv1 - End Of Life, for Node \u003c 16, contains security vulnerabilities, use at your own risk  \n\n## Contributing\n\nTo contribute to this repository, see the [contribution guide](./CONTRIBUTING.md)\n\nTo build:\n\n```bash\n$ npm run build\n```\n\nTo run all tests:\n```bash\n$ npm test\n```\n\nTo just run unit tests:\n```bash\n$ npm run units\n```\n\n## Code of Conduct\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\n## Security Issues\n\nDo you think there might be a security issue?\nHave you been phished or identified a security vulnerability?\nPlease don't report it here - let us know by sending an email to secure@microsoft.com.\n","funding_links":[],"categories":["Table of Contents"],"sub_categories":["HTTP"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMicrosoft%2Ftyped-rest-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMicrosoft%2Ftyped-rest-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMicrosoft%2Ftyped-rest-client/lists"}