garrysmod icon indicating copy to clipboard operation
garrysmod copied to clipboard

Add http.GetStatusDescription

Open vicentefelipechile opened this issue 2 years ago • 2 comments

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

vicentefelipechile avatar May 16 '23 20:05 vicentefelipechile

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

WilliamVenner avatar May 18 '23 17:05 WilliamVenner

Done!

vicentefelipechile avatar May 18 '23 17:05 vicentefelipechile