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

Add http.GetStatusDescription #1969

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

vicentefelipechile
Copy link
Contributor

@vicentefelipechile vicentefelipechile commented May 16, 2023

This function returns the name of the request (e.g., 200 -> "OK") and the description of the request (e.g., 200 -> "The resource has been obtained").
If the request with that value is not found or does not exist, it will return nil.

For example:

local msg, desc = http.GetStatusDescription(200)
print( msg, desc )
print( http.GetStatusDescription(499) )

Output:

OK      The resource has been obtained
nil

This function returns the name of the request (e.g., 200 -> "OK") and the description of the request (e.g., 200 -> "The resource has been obtained").

If the request with that value is not found or does not exist, it will return nil.
@vicentefelipechile vicentefelipechile changed the title Added http.HandleCode Add http.HandleCode May 16, 2023
@WilliamVenner
Copy link
Contributor

Maybe http.GetStatusDescription would be a better name? http.HandleCode implies that some processing takes place when called.

@vicentefelipechile
Copy link
Contributor Author

Done!

@vicentefelipechile vicentefelipechile changed the title Add http.HandleCode Add http.GetStatusDescription May 18, 2023
@robotboy655 robotboy655 added the Addition The pull request adds new functionality. label May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Addition The pull request adds new functionality.
Projects
None yet
3 participants