Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TTCN-3 Libraries
LibIts
Commits
4c79dd3f
Commit
4c79dd3f
authored
Jun 20, 2019
by
YannGarcia
Browse files
Enhance templates
parent
903d7d1c
Changes
2
Hide whitespace changes
Inline
Side-by-side
ttcn/Http/LibItsHttp_Templates.ttcn
View file @
4c79dd3f
...
...
@@ -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
...
...
ttcn/Http/LibItsHttp_TypesAndValues.ttcn
View file @
4c79dd3f
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment