Commit acec63bf authored by YannGarcia's avatar YannGarcia
Browse files

Add missing templates

parent 4c79dd3f
......@@ -73,30 +73,49 @@ module LibItsHttp_Templates {
body := p_body
} // End of template m_http_request_get
template (omit) Request m_http_request_post(
in charstring p_uri,
in template (value) HeaderLines p_headers,
in template (omit) HttpMessageBody p_body := omit
template Request mw_http_request_get(
template (present) charstring p_uri := ?,
template (present) HeaderLines p_headers := ?,
template HttpMessageBody p_body := *
) := {
method := "POST",
method := "GET",
uri := p_uri,
version_major := c_http_version_major,
version_minor := c_http_version_minor,
header := p_headers,
body := p_body
} // End of template mw_http_request_get
template (omit) Request m_http_request_post(
in charstring p_uri,
in template (value) HeaderLines p_headers,
in template (omit) HttpMessageBody p_body := omit
) modifies m_http_request_get := {
method := "POST"
} // End of template m_http_request_post
template Request mw_http_request_post(
template (present) charstring p_uri := ?,
template (present) HeaderLines p_headers := ?,
template HttpMessageBody p_body := *
) := {
method := "POST",
uri := p_uri,
version_major := c_http_version_major,
version_minor := c_http_version_minor,
header := p_headers,
body := p_body
) modifies mw_http_request_get := {
method := "POST"
} // End of template mw_http_request_post
template (omit) Request m_http_request_delete(
in charstring p_uri,
in template (value) HeaderLines p_headers,
in template (omit) HttpMessageBody p_body := omit
) modifies m_http_request_get := {
method := "DELETE"
} // End of template m_http_request_delete
template Request mw_http_request_delete(
template (present) charstring p_uri := ?,
template (present) HeaderLines p_headers := ?,
template HttpMessageBody p_body := *
) modifies mw_http_request_get := {
method := "DELETE"
} // End of template mw_http_request_post
} // End of group http_requests
......@@ -122,7 +141,7 @@ module LibItsHttp_Templates {
version_major := 1,
version_minor := 1,
statuscode := 200,
statustext := ?,//"OK",
statustext := "OK",
header := p_header,
body := p_body
} // End of template mw_http_response_ok
......@@ -132,7 +151,15 @@ module LibItsHttp_Templates {
template (present) HeaderLines p_header := ?
) modifies mw_http_response_ok := {
statuscode := 201,
statustext := ?//"Created",
statustext := "Created"
} // End of template mw_http_response_ok
template (present) Response mw_http_response_204_no_content(
template (present) HttpMessageBody p_body := ?,
template (present) HeaderLines p_header := ?
) modifies mw_http_response_ok := {
statuscode := 204,
statustext := "No Content"
} // End of template mw_http_response_ok
template (value) Response m_http_response_ko(
......@@ -179,7 +206,7 @@ module LibItsHttp_Templates {
template (present) HeaderLines p_header := ?
) modifies mw_http_response_ko := {
statuscode := 400,
statustext := ? // TODO Add pattern for not found
statustext := "Bad Request"
} // End of template mw_http_response_400_bad_request
template Response mw_http_response_403_forbidden(
......@@ -187,17 +214,25 @@ module LibItsHttp_Templates {
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
statustext := "Forbidden"
} // End of template mw_http_response_403_forbidden
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
statustext := "Not Found"
} // End of template mw_http_response_404_not_found
template Response mw_http_response_412_precondition_failed(
template HttpMessageBody p_body := *,
template (present) HeaderLines p_header := ?
) modifies mw_http_response_ko := {
statuscode := 412,
statustext := "Precondition Failed"
} // End of template mw_http_response_412_not_found
} // End of group http_responses
group http_xml_body {
......
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