https://github.com/maifeeulasad/http-response-details
https://github.com/maifeeulasad/http-response-details
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/maifeeulasad/http-response-details
- Owner: maifeeulasad
- License: mit
- Created: 2021-01-19T08:13:02.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2025-03-27T09:48:49.000Z (about 1 year ago)
- Last Synced: 2025-09-24T01:30:23.280Z (9 months ago)
- Homepage: https://www.npmjs.com/package/http-response-details
- Size: 35.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐ก http-response-details [![NPM Downloads][downloads-image]][downloads-url]
[downloads-image]: https://img.shields.io/npm/dm/http-response-details.svg
[downloads-url]: https://npmcharts.com/compare/http-response-details?minimal=true
## Example (pure Node.js) ๐:
```javascript
const httpCodes = require("http-response-details");
console.log(httpCodes["400"]); // ๐ซ Bad Request
console.log(httpCodes["201"]); // โ
Created
```
## Example (React.js) โ๏ธ:
```javascript
import React from "react";
const httpCodes = require("http-response-details");
class App extends React.Component {
constructor(props) {
super(props);
//console.log("test");
//console.log(httpCodes);
console.log(httpCodes["400"]); // ๐ซ Bad Request
console.log(httpCodes["201"]); // โ
Created
//or inside other life-cycle method or anywhere
}
render() {
return
;
}
}
export default App;
```
## Try it on CodeSandbox.io ๐งช:
[https://codesandbox.io/s/http-response-details-example-39lhm?file=/src/App.js](https://codesandbox.io/s/http-response-details-example-39lhm?file=/src/App.js)