- This topic has 5 replies, 2 voices, and was last updated 2 years, 9 months ago by .
-
Topic
-
Cloverleaf 20.1.1.1 – I am having an issue conforming the HEADER of the request with the Bearer token. Seems that the string is truncated after 1024 chars in a keyed list after calling the GET { set res [httpget $queryList2] } in the TIME mode. The keyed list is properly set as far I can see. Of course, the response after executing the http GET verb is HTTP/1.1 403 Forbidden due to the truncation. The other params are read correctly as per http-client configuration fields.
Attached TCL snippet modified based on the “gc_httpClientQuery” provided by Infor samples.
Any guidance is really appreciated!
start {
# grab and store CFGS values for run/time mode —
# CFGS are only available in start mode.
keylget args CFGS cfgs
keylget cfgs URL url
keylget cfgs HEADERS headersset udata {}
keylset udata Content-Type { application/json }
keylset udata Authorization { Bearer eyJraWQiOiJRMm9UdXZJRzlDRG5GeU5wbG9ndkowMUVA … }
set data “”
keylset queryList2 URL $url DATA $data HEADERS $udata DEBUG $debug
}time {
# fetch the URL using the specified method
# the URL used will be taken from NetConfig
#echo QUERY $queryList
echo QUERY $queryList2set term 0 ; set ctr 0
while { !$term && ($ctr <= 3) } {
keylget cfgs METHOD method
switch -exact — $method {
PUT { set res [httpput $cfgs] }
POST { set res [httppost $queryList] }
GET { set res [httpget $queryList2] }
}echo RESPONSE: $res
GET { set res [httpget $queryList2] }
.
.
.
}
- You must be logged in to reply to this topic.