Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aaronpowell/httpstatus
Easily generate different HTTP responses for testing
https://github.com/aaronpowell/httpstatus
Last synced: 6 days ago
JSON representation
Easily generate different HTTP responses for testing
- Host: GitHub
- URL: https://github.com/aaronpowell/httpstatus
- Owner: aaronpowell
- License: mit
- Created: 2011-02-03T02:14:18.000Z (almost 14 years ago)
- Default Branch: main
- Last Pushed: 2024-04-03T23:33:10.000Z (9 months ago)
- Last Synced: 2024-04-14T16:06:24.071Z (8 months ago)
- Language: C#
- Homepage: http://httpstat.us
- Size: 693 KB
- Stars: 672
- Watchers: 73
- Forks: 73
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: License.md
Awesome Lists containing this project
- awesome - aaronpowell/httpstatus - Easily generate different HTTP responses for testing (C\#)
README
# httpstat.us
Welcome to [httpstat.us](https://httpstat.us), your simplest way to test HTTP status codes!
Point your app to [httpstat.us](https://httpstat.us) and append the status code you want to test, then make a request and we'll return that for you.
```js
async function getData(url) {
const res = await fetch(url);if (!res.ok) {
throw new Error("Failed to get data");
}
return await res.json();
}getData("https://httpstat.us/500").then(console.log).catch(console.error);
```Learn more at [httpstat.us](https://httpstat.us).
## Tech
The site is .NET 9 and it is hosted as a [containerised Azure AppService](https://azure.microsoft.com/services/app-service/containers/?WT.mc_id=dotnet-00000-aapowell#overview).
## Self hosting
If you want, you are able to self-host the service using the provided image, which can be found [on GitHub packages](https://github.com/aaronpowell/httpstatus/pkgs/container/httpstatus). This may be useful for testing HTTP status codes which are not available in Azure, or time outs longer than we support in the hosted version.
## LICENSE
[License](./License.md).