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
41563399
Commit
41563399
authored
Oct 01, 2019
by
YannGarcia
Browse files
Merge branch 'STF525' of
https://forge.etsi.org/gitlab/LIBS/LibIts
into STF525
parents
8cf688e6
25c8a9e7
Changes
3
Hide whitespace changes
Inline
Side-by-side
ttcn/Http/LibItsHttp_Functions.ttcn
View file @
41563399
...
...
@@ -66,8 +66,10 @@ module LibItsHttp_Functions {
v_i
:=
v_i
+
1
;
p_headers
[
v_i
]
:=
{
c_header_cache_control
,
{
"no-cache"
}
};
v_i
:=
v_i
+
1
;
p_headers
[
v_i
]
:=
{
c_header_authorization
,
{
"Basic YWxhZGRpbjpvcGVuc2VzYW1l"
}
};
//v_i := v_i + 1;
if
(
PICS_USE_TOKEN_HEADER
)
{
p_headers
[
v_i
]
:=
{
c_header_authorization
,
{
PICS_TOKEN_HEADER
}
};
// aladdin:opensesame
v_i
:=
v_i
+
1
;
}
//p_headers[v_i] := { c_header_accept, { "application/x-its-response" } };
}
// End of function f_init_default_headers_list
...
...
ttcn/Http/LibItsHttp_Pics.ttcn
View file @
41563399
...
...
@@ -20,4 +20,15 @@ module LibItsHttp_Pics {
*/
modulepar
charstring
PICS_HEADER_CONTENT_TYPE
:=
"application/x-its-request"
;
/**
* @desc Set to false in TOKEN header shall not be used
*/
modulepar
boolean
PICS_USE_TOKEN_HEADER
:=
true
;
/**
* @desc HTTP TOKEN value
* "YWxhZGRpbjpvcGVuc2VzYW1l==" is the base64 encoding of the login:password "aladdin:opensesame"
*/
modulepar
charstring
PICS_TOKEN_HEADER
:=
"Basic "
&
"YWxhZGRpbjpvcGVuc2VzYW1l=="
;
// aladdin:opensesame
}
// End of module LibItsHttp_Pics
ttcn/Http/LibItsHttp_Templates.ttcn
View file @
41563399
...
...
@@ -102,6 +102,22 @@ module LibItsHttp_Templates {
method
:=
"POST"
}
// End of template mw_http_request_post
template
(
omit
)
Request
m_http_request_put
(
in
charstring
p_uri
,
in
template
(
value
)
HeaderLines
p_headers
,
in
template
(
omit
)
HttpMessageBody
p_body
:=
omit
)
modifies
m_http_request_get
:=
{
method
:=
"PUT"
}
// End of template m_http_request_put
template
Request
mw_http_request_put
(
template
(
present
)
charstring
p_uri
:=
?
,
template
(
present
)
HeaderLines
p_headers
:=
?
,
template
HttpMessageBody
p_body
:=
*
)
modifies
mw_http_request_get
:=
{
method
:=
"PUT"
}
// End of template mw_http_request_put
template
(
omit
)
Request
m_http_request_delete
(
in
charstring
p_uri
,
in
template
(
value
)
HeaderLines
p_headers
,
...
...
@@ -134,6 +150,24 @@ module LibItsHttp_Templates {
body
:=
p_body
}
// End of template m_http_response_ok
template
(
value
)
Response
m_http_response_ok_no_body
(
in
template
(
value
)
HeaderLines
p_header
)
:=
{
version_major
:=
1
,
version_minor
:=
1
,
statuscode
:=
200
,
statustext
:=
"OK"
,
header
:=
p_header
,
body
:=
omit
}
// End of template m_http_response_ok_no_body
template
(
value
)
Response
m_http_response_204_no_content
(
in
template
(
value
)
HeaderLines
p_header
)
modifies
m_http_response_ok_no_body
:=
{
statuscode
:=
204
,
statustext
:=
"No Content"
}
// End of template m_http_response_204_no_content
template
(
present
)
Response
mw_http_response_ok
(
template
(
present
)
HttpMessageBody
p_body
:=
?
,
template
(
present
)
HeaderLines
p_header
:=
?
...
...
@@ -154,6 +188,14 @@ module LibItsHttp_Templates {
statustext
:=
"Created"
}
// End of template mw_http_response_ok
template
(
present
)
Response
mw_http_response_202_accepted
(
template
(
present
)
HttpMessageBody
p_body
:=
?
,
template
(
present
)
HeaderLines
p_header
:=
?
)
modifies
mw_http_response_ok
:=
{
statuscode
:=
202
,
statustext
:=
"Accepted"
}
// 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
:=
?
...
...
@@ -209,6 +251,14 @@ module LibItsHttp_Templates {
statustext
:=
"Bad Request"
}
// End of template mw_http_response_400_bad_request
template
Response
mw_http_response_401_unauthorized
(
template
HttpMessageBody
p_body
:=
*
,
template
(
present
)
HeaderLines
p_header
:=
?
)
modifies
mw_http_response_ko
:=
{
statuscode
:=
401
,
statustext
:=
"Unauthorized"
}
// End of template mw_http_response_401_unauthorized
template
Response
mw_http_response_403_forbidden
(
template
HttpMessageBody
p_body
:=
*
,
template
(
present
)
HeaderLines
p_header
:=
?
...
...
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