Commit 4c79dd3f authored by YannGarcia's avatar YannGarcia
Browse files

Enhance templates

parent 903d7d1c
......@@ -127,6 +127,14 @@ module LibItsHttp_Templates {
body := p_body
} // End of template mw_http_response_ok
template (present) Response mw_http_response_201_created(
template (present) HttpMessageBody p_body := ?,
template (present) HeaderLines p_header := ?
) modifies mw_http_response_ok := {
statuscode := 201,
statustext := ?//"Created",
} // End of template mw_http_response_ok
template (value) Response m_http_response_ko(
in template (value) HttpMessageBody p_body,
in template (value) HeaderLines p_header,
......@@ -166,13 +174,29 @@ module LibItsHttp_Templates {
body := p_body
} // End of template mw_http_response_ko
template Response mw_http_response_400_bad_request(
template HttpMessageBody p_body := *,
template (present) HeaderLines p_header := ?
) modifies mw_http_response_ko := {
statuscode := 400,
statustext := ? // TODO Add pattern for not found
} // End of template mw_http_response_400_bad_request
template Response mw_http_response_403_forbidden(
template HttpMessageBody p_body := *,
template (present) HeaderLines p_header := ?
) modifies mw_http_response_ko := {
statuscode := 403,
statustext := ? // TODO Add pattern for not found
} // End of template mw_http_response_404_not_found
template Response mw_http_response_404_not_found(
template HttpMessageBody p_body := *,
template (present) HeaderLines p_header := ?
) modifies mw_http_response_ko := {
statuscode := 404,
statustext := ? // TODO Add pattern for not found
} // End of template mw_http_response_ok
} // End of template mw_http_response_404_not_found
} // End of group http_responses
......
......@@ -23,6 +23,7 @@ module LibItsHttp_TypesAndValues {
const charstring c_header_connection := "Connection";
const charstring c_header_pragma := "Pragma";
const charstring c_header_cache_control := "Cache-Control";
const charstring c_header_authorization := "Authorization";
const integer c_http_version_major := PICS_HTTP_VERSION_MAJOR;
const integer c_http_version_minor := PICS_HTTP_VERSION_MINOR;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment