class virtual message : body:string -> headers:(string * string) list -> version:Http_types.version option -> clisockaddr:Unix.sockaddr -> srvsockaddr:Unix.sockaddr ->
object
.. end
OO representation of an HTTP message
headers
: message headers shipped with the message
method version : Http_types.version option
Returns message HTTP version, it can be None because older version
of the HTTP protocol don't require HTTP version to be told between
message source and destination
method setVersion : Http_types.version -> unit
set message HTTP version
method body : string
Returns message body
method setBody : string -> unit
set message body
method bodyBuf : Buffer.t
Returns a Buffer.t connected to message body (Warning: changing this
buffer will change message body too)
method setBodyBuf : Buffer.t -> unit
set a new Buffer.t used to keep message body
method addBody : string -> unit
append a string to message body
method addBodyBuf : Buffer.t -> unit
append a whole buffer to message body
header name comparison are performed in a case-insensitive manner
as required by RFC2616, actually the implementation works converting all
header names in lowercasemethod addHeader : name:string -> value:string -> unit
add an HTTP header
name
: header's name
value
: header's value
method addHeaders : (string * string) list -> unit
add a list of HTTP headers
method replaceHeader : name:string -> value:string -> unit
like addHeader but replace previous definition of the same header
method replaceHeaders : (string * string) list -> unit
like addHeaders but replace previous definition of headers that were
already defined
method removeHeader : name:string -> unit
remove _all_ occurences of an HTTP header from the message
name
: name of the header to be removed
method hasHeader : name:string -> bool
Returns true if given header exists in message, false otherwise
method header : name:string -> string
Raises Header_not_found
if given header wasn't defined in message
Returns value associated to a given header
name
: name of the header to lookup
method headers : (string * string) list
Returns the full set of headers defined for this message, the value
returned is an association list from headers name to headers value, an
header may occurs more that once in the list
method clientSockaddr : Unix.sockaddr
Returns client Unix.sockaddr
method clientAddr : string
Returns client address pretty printed
method clientPort : int
Returns client port
method serverSockaddr : Unix.sockaddr
Returns server Unix.sockaddr
method serverAddr : string
Returns server address pretty printed
method serverPort : int
Returns server port
method private virtual fstLineToString : string
Returns for requests first request line, for responses first
response line.
User by derived requests and responses to implement toString method
method toString : string
Returns a string representation of the message
method serialize : Pervasives.out_channel -> unit
serialize the message over an output channel