GNU
|
Liberty Eiffel
|
Automated Tests
|
Wiki
|
Savannah project
|
Debian packages
|
Documentation
>
tutorial
>
HTTP_GET_HANDLER
+
Point of view
All features
ANY
HTTP_CONNECTION
All features
class HTTP_GET_HANDLER
Summary
top
Direct parents
Inherit list:
HTTP_METHOD_HANDLER
Class invariant
top
response_header /= Void
response_body /= Void
Overview
top
Creation features
{
HTTP_CONNECTION
}
make
(a_method:
STRING
, a_uri:
STRING
, a_version:
STRING
)
Features
{
HTTP_CONNECTION
}
method
:
STRING
the request method (GET, POST, etc.)
expect_body
:
BOOLEAN
True if the request must have a body.
prepare_ok
:
BOOLEAN
True if
prepare_answer
has been completed correctly
prepare_answer
Prepare the answer of the request
add_header
(header:
STRING
)
A request
a_header
is added
add_body
(body:
STRING
)
A request
a_body
is added.
make
(a_method:
STRING
, a_uri:
STRING
, a_version:
STRING
)
expect
(events:
EVENTS_SET
)
is_ready
(events:
EVENTS_SET
):
BOOLEAN
Current
ca be used to manage a request.
{}
file
:
TEXT_FILE_READ
tfr
:
TEXT_FILE_READ
{}
fill_body
(f:
TEXT_FILE_READ
)
Implementation
{
HTTP_CONNECTION
}
code
:
INTEGER_32
the HTTP answer code
begin_answer
Launched before the answer preparation
answer
(a_out_stream:
OUTPUT_STREAM
)
Send the request answer to the
a_out_stream
done
:
BOOLEAN
True when the answer has been send
{}
uri
:
STRING
the source URI
version
:
STRING
the http version (1.0, 1.1, etc.)
response_header
:
FAST_ARRAY
[
STRING
]
Every headers of the request
response_body
:
STRING
The complete body of the request
default_body
A defaut answer's body
set_content_length
Set the lenght of the answer's body
reason
:
STRING
A text representation of the answer
code
newline
(a_out_stream:
OUTPUT_STREAM
)
output CRLF
method
:
STRING
writable attribute
{
HTTP_CONNECTION
}
top
the request method (GET, POST, etc.)
expect_body
:
BOOLEAN
is True
constant attribute
{
HTTP_CONNECTION
}
top
True if the request must have a body.
prepare_ok
:
BOOLEAN
writable attribute
{
HTTP_CONNECTION
}
top
True if
prepare_answer
has been completed correctly
prepare_answer
effective procedure
{
HTTP_CONNECTION
}
top
Prepare the answer of the request
require
not done
add_header
(header:
STRING
)
effective procedure
{
HTTP_CONNECTION
}
top
A request
a_header
is added
add_body
(body:
STRING
)
effective procedure
{
HTTP_CONNECTION
}
top
A request
a_body
is added.
require
expect_body
make
(a_method:
STRING
, a_uri:
STRING
, a_version:
STRING
)
effective procedure
{
HTTP_CONNECTION
}
top
require
a_method.is_equal("GET") or else a_method.is_equal("POST")
ensure
version
.is_equal(a_version)
expect
(events:
EVENTS_SET
)
effective procedure
{
HTTP_CONNECTION
}
top
is_ready
(events:
EVENTS_SET
):
BOOLEAN
effective function
{
HTTP_CONNECTION
}
top
Current
ca be used to manage a request.
file
:
TEXT_FILE_READ
effective function
{}
top
ensure
Result /= Void implies Result.is_connected
tfr
:
TEXT_FILE_READ
once function
{}
top
fill_body
(f:
TEXT_FILE_READ
)
effective procedure
{}
top
code
:
INTEGER_32
writable attribute
{
HTTP_CONNECTION
}
top
the HTTP answer code
begin_answer
effective procedure
{
HTTP_CONNECTION
}
top
Launched before the answer preparation
answer
(a_out_stream:
OUTPUT_STREAM
)
effective procedure
{
HTTP_CONNECTION
}
top
Send the request answer to the
a_out_stream
require
not
done
prepare_ok
done
:
BOOLEAN
writable attribute
{
HTTP_CONNECTION
}
top
True when the answer has been send
uri
:
STRING
writable attribute
{}
top
the source URI
version
:
STRING
writable attribute
{}
top
the http version (1.0, 1.1, etc.)
response_header
:
FAST_ARRAY
[
STRING
]
writable attribute
{}
top
Every headers of the request
response_body
:
STRING
writable attribute
{}
top
The complete body of the request
default_body
effective procedure
{}
top
A defaut answer's body
set_content_length
effective procedure
{}
top
Set the lenght of the answer's body
reason
:
STRING
effective function
{}
top
A text representation of the answer
code
newline
(a_out_stream:
OUTPUT_STREAM
)
effective procedure
{}
top
output CRLF