Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NGN.NET Constants (Extension?) #6

Open
coreybutler opened this issue Aug 26, 2018 · 0 comments
Open

NGN.NET Constants (Extension?) #6

coreybutler opened this issue Aug 26, 2018 · 0 comments

Comments

@coreybutler
Copy link
Member

From ngn-core created by coreybutler : ngnjs/ngn-core#22

A library of constants may help simplify network requests. This would likely be best as an extension to NGN instead of a core element of the library, since it is not required to make a network request.

Just a few examples:

  • NGN.NET.PORT.HTTP refers to port 80
  • NGN.NET.PORT.HTTPS & NGN.NET.PORT.TLS refer to port 443
  • NGN.NET.PORT.LDAP refers to port 53
  • NGN.NET.PORT.SLDAP refers to port 686
  • NGN.NET.PORT.SSH refers to port 21
  • NGN.NET.PORT.SMTP refers to port 25

These could also be aliased with friendly names like NGN.NET.PORT.EMAIL which could refer to the SMTP port.

The purpose of these constants is to simplify network connectivity for developers who are less familiar with common port values.

Additionally, HTTP status code constants/references may be useful.

A few examples include:

  • NGN.NET.STATUS.OK refers to 200.
  • NGN.NET.STATUS.SUCCESS refers to 2XX.
  • NGN.NET.STATUS.FAILURE refers to 4XX and 5XX.
  • NGN.NET.STATUS.DENIED refers to 401.
@coreybutler coreybutler transferred this issue from ngnjs/NGN Aug 30, 2020
coreybutler added a commit that referenced this issue Aug 30, 2020
…with both callback and promise-based HTTP requests to close #1. Now includes a URL class to fix #4. A Credential class abstracts username/password/token auth. The Credential class supports Authorization and Proxy-Authorization to close #2. Some constants are included in the library, as requested in #6, but only those relevant to network _requests_.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant