garrysmod
garrysmod copied to clipboard
Add http.GetStatusDescription
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
Maybe http.GetStatusDescription would be a better name? http.HandleCode implies that some processing takes place when called.
Done!