Web app hot fix (#459)

* Web app hot fix

* Small tweak
This commit is contained in:
Brahim Hadriche authored and GitHub committed 2024-09-22 13:29:06 -04:00
1 parent 4f31c206ea
commit 11d1aef201
8 files changed
+451 -2

No files matched your search

@@ -119,6 +119,20 @@ namespace HttpClient
return (new HttpRequest()).Method("HEAD").Url(url)
end function
function FromObject(obj as object) as HttpRequest
request = new HttpRequest()
for each key in obj
if IsFunction(request[key])
request[key](obj[key])
else
throw `Invalid key: "${key}" in object passed to HttpClient.FromObject`
end if
end for
return request
end function
class HttpRequest
public urlTransfer as object
@@ -598,6 +612,10 @@ namespace HttpClient
m._statusCode = statusCode
end function
function OverrideText(text as string)
m._text = text
end function
function IsSuccess() as boolean
statusCode = m.StatusCode()
return statusCode >= 200 and statusCode < 400