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
acec63bf
Commit
acec63bf
authored
Jul 11, 2019
by
YannGarcia
Browse files
Add missing templates
parent
4c79dd3f
Changes
1
Hide whitespace changes
Inline
Side-by-side
ttcn/Http/LibItsHttp_Templates.ttcn
View file @
acec63bf
...
...
@@ -73,30 +73,49 @@ module LibItsHttp_Templates {
body
:=
p_body
}
// End of template m_http_request_get
template
(
omit
)
Request
m_http_request_
pos
t
(
in
charstring
p_uri
,
in
template
(
value
)
HeaderLines
p_headers
,
in
template
(
omit
)
HttpMessageBody
p_body
:=
omit
template
Request
m
w
_http_request_
ge
t
(
template
(
present
)
charstring
p_uri
:=
?
,
template
(
present
)
HeaderLines
p_headers
:=
?
,
template
HttpMessageBody
p_body
:=
*
)
:=
{
method
:=
"
POS
T"
,
method
:=
"
GE
T"
,
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_40
4_not_found
statustext
:=
"Forbidden"
}
// End of template mw_http_response_40
3_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 n
ot
f
ound
statustext
:=
"N
ot
F
ound
"
}
// 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
{
...
...
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