|
|
@ -1099,15 +1099,22 @@ def WebRequestParseFile(inRequest=None):
|
|
|
|
|
|
|
|
|
|
|
|
return lResultTurple
|
|
|
|
return lResultTurple
|
|
|
|
|
|
|
|
|
|
|
|
def WebRequestResponseSend(inResponeStr, 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: Response string
|
|
|
|
:param inRequest: inRequest from the server. Optional if call def from request thread
|
|
|
|
:param inRequest: inRequest from the server. Optional if call def from request thread
|
|
|
|
|
|
|
|
:param inContentTypeStr: Type content-type. Example: "html/text"
|
|
|
|
|
|
|
|
:param inHeadersDict: Dict of the headers for the response
|
|
|
|
:return:
|
|
|
|
:return:
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
if inRequest is None: inRequest = WebRequestGet()
|
|
|
|
if inRequest is None: inRequest = WebRequestGet()
|
|
|
|
inRequest.OpenRPAResponseDict["Body"] = bytes(inResponeStr, "utf8")
|
|
|
|
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():
|
|
|
|
def WebRequestGet():
|
|
|
|