... ELSE BuiltIn.Should_Be_Equal ${expected_text} ${response}
Get_From_Uri
- [Arguments] ${uri} ${accept} ${session}=default ${normalize_json}=False
+ [Arguments] ${uri} ${accept}=${ACCEPT_EMPTY} ${session}=default ${normalize_json}=False
[Documentation] GET data from given URI, check status code and return response text.
- ... \${accept} is a mandatory Python object with headers to use.
- ... If \${normalize_json}, normalize text before returning.
+ ... \${accept} is a Python object with headers to use.
+ ... If \${normalize_json}, normalize as JSON text before returning.
BuiltIn.Log ${uri}
BuiltIn.Log ${accept}
${response} = RequestsLibrary.Get_Request alias=${session} uri=${uri} headers=${accept}
${items} = BuiltIn.Create_List
${separator} = BuiltIn.Set_Variable_If '${extension}' != 'json' ${endline} ,${endline}
: FOR ${iteration} IN RANGE ${iter_start} ${iterations}+${iter_start}
- \ # Add separator only if we are beyond first item.
\ BuiltIn.Run_Keyword_If ${iteration} > ${iter_start} Collections.Append_To_List ${items} ${separator}
\ ${item} = BuiltIn.Evaluate string.Template('''${item_template}''').substitute({"i":"${iteration}"}) modules=string
\ Collections.Append_To_List ${items} ${item}