dart-lang / web

Lightweight browser API bindings built around JS static interop.
https://pub.dev/packages/web
BSD 3-Clause "New" or "Revised" License
128 stars 22 forks source link

Add HttpStatus codes api seen in dart html library #280

Closed rutvik110 closed 1 month ago

rutvik110 commented 1 month ago

Issue:

Dart html library exports HttpStatus abstract class that defines various http status codes. I can't find a replacement for this in the web package. Currently, the HttpStatus is part of darts internal apis so one can't directly import it in their project but this api is exported only through dart html and io libraries. As web is replacing the html library eventually, addition of this api would be quite handy.

Proposal:

Add HttpStatus api similar to one exported from html library. I believe one can just copy the api from dart sdk which should be good enough. I'm ready to put up a PR on this.

srujzs commented 1 month ago

Good idea, thanks for volunteering! We should add this in some form to the helpers. The only detail I'm not sure of is the naming of the class and if we want to avoid colliding with the dart:html name for some reason, but that can be discussed in the code review.