From 01897d7decadf7af6a425696215195cd0d722593 Mon Sep 17 00:00:00 2001 From: Ivan Maslov Date: Tue, 7 Jun 2022 10:52:25 +0300 Subject: [PATCH 1/2] Update WebRequestResponseSend --- Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py | 9 ++++++++- changelog.md | 5 +++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py b/Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py index b47d891d..87e37e64 100644 --- a/Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py +++ b/Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py @@ -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(): diff --git a/changelog.md b/changelog.md index 09a1af81..72ed5f83 100644 --- a/changelog.md +++ b/changelog.md @@ -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 From 81160b5db67c83bc22177af936bef20006c0296e Mon Sep 17 00:00:00 2001 From: robo-bo Date: Tue, 7 Jun 2022 12:18:11 +0300 Subject: [PATCH 2/2] Docs fix --- Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py b/Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py index 87e37e64..d9eb4dac 100644 --- a/Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py +++ b/Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py @@ -1101,12 +1101,12 @@ def WebRequestParseFile(inRequest=None): def WebRequestResponseSend(inResponeStr, inRequest=None, inContentTypeStr: str = None, inHeadersDict: dict = None): """ - Send response for the request + Set response for the request - :param inResponeStr: + :param inResponeStr: Response string :param inRequest: inRequest from the server. Optional if call def from request thread - :param inContentTypeStr: - :param inHeadersDict: + :param inContentTypeStr: Type content-type. Example: "html/text" + :param inHeadersDict: Dict of the headers for the response :return: """ if inRequest is None: inRequest = WebRequestGet()