Process local http request (#599)
* Local http? * option utils * Fix for hanging web app * Lint fix --------- Co-authored-by: github-action linter <githubaction@githubaction.com>
This commit is contained in:
1 parent
fae875845a
commit
f3f9327c1c
8 files changed
+123
-11
No files matched your search
@@ -149,6 +149,10 @@ namespace HttpClient
|
||||
return m
|
||||
end function
|
||||
|
||||
function GetMethod() as string
|
||||
return m._method
|
||||
end function
|
||||
|
||||
function Url(url as string) as HttpRequest
|
||||
m._url = url
|
||||
return m
|
||||
@@ -221,11 +225,22 @@ namespace HttpClient
|
||||
return m
|
||||
end function
|
||||
|
||||
function GetHeaders() as object
|
||||
if m._headers = invalid
|
||||
m._headers = {}
|
||||
end if
|
||||
return m._headers
|
||||
end function
|
||||
|
||||
function Body(body as dynamic) as HttpRequest
|
||||
m._body = ValidString(body)
|
||||
return m
|
||||
end function
|
||||
|
||||
function GetBody() as dynamic
|
||||
return m._body
|
||||
end function
|
||||
|
||||
function Json(body as object) as HttpRequest
|
||||
m.Body(FormatJson(body))
|
||||
m.Header("Content-Type", "application/json")
|
||||
@@ -612,6 +627,10 @@ namespace HttpClient
|
||||
m._json = json
|
||||
end function
|
||||
|
||||
function OverrideHeaders(headers as object)
|
||||
m._headers = headers
|
||||
end function
|
||||
|
||||
function OverrideErrorMessage(errorMessage as string)
|
||||
m._errorMessage = errorMessage
|
||||
end function
|
||||
|
||||
Reference in new issue
Block a user