HttpVersionIds.validSyntax

Checks whether id has a valid syntax for a HTTP version identifier string:

"HTTP" "/" 1*DIGIT "." 1*DIGIT

@see http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.1

struct HttpVersionIds
static
bool
validSyntax

Parameters

id cstring

HTTP version identifier string

Return Value

Type: bool

true if d has a valid syntax for a HTTP version identifier string or false otherwise.

Examples

Unittest for validSyntax()

test (validSyntax("HTTP/1.1"));
test (validSyntax("HTTP/1.23"));
test (validSyntax("HTTP/123.456"));
test (!validSyntax("HTTP/123456"));
test (!validSyntax("HTTP/.123456"));
test (!validSyntax("HTTP/1,1"));
test (!validSyntax("HTTP/1."));
test (!validSyntax("HTTP/.1"));
test (!validSyntax("HTTP/."));
test (!validSyntax("HTTP/"));
test (!validSyntax(""));

Meta