Update WebRequestResponseSend

dev-linux
Иван Маслов 2 years ago
parent a63853915b
commit 01897d7dec

@ -1099,15 +1099,22 @@ def WebRequestParseFile(inRequest=None):
return lResultTurple
def WebRequestResponseSend(inResponeStr, inRequest=None):
def WebRequestResponseSend(inResponeStr, inRequest=None, inContentTypeStr: str = None, inHeadersDict: dict = None):
"""
Send response for the request
:param inResponeStr:
:param inRequest: inRequest from the server. Optional if call def from request thread
:param inContentTypeStr:
:param inHeadersDict:
:return:
"""
if inRequest is None: inRequest = WebRequestGet()
inRequest.OpenRPAResponseDict["Body"] = bytes(inResponeStr, "utf8")
if inHeadersDict is not None:
inRequest.OpenRPAResponseDict["Headers"].update(inHeadersDict)
if inContentTypeStr is not None:
inRequest.OpenRPAResponseDict["Headers"]["Content-type"] = inContentTypeStr
def WebRequestGet():

@ -4,6 +4,11 @@ STD - STUDIO
RBT - ROBOT
AGT - AGENT
[1.2.13]
- ORCHESTRATOR
- - def WebRequestResponseSend(inResponeStr, inRequest=None, inContentTypeStr: str = None, inHeadersDict: dict = None):
[1.2.12]
2022_Q2
- ORCHESTRATOR

Loading…
Cancel
Save