Dave's Brain

Browse - Programming Tips - How can I convert a http status number into a range?

Date: 2015aug19
Language: C/C++

Q.  How can I convert a http status number into a range?

A.

// Eg 503 -> 500 // Eg 555 -> 500 int getStatusRange(const int status) { return (status / 100) * 100; }
A 1xx status is informational. A 2xx status is success. A 3xx status is redirection. A 4xx status is client error. A 5xx status is server error.

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.