[skip ci] various small changes
This commit is contained in:
1 parent
4e8dfe1a23
commit
e80a41ca72
3 files changed
+7
-29
No files matched your search
@@ -113,20 +113,6 @@ 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
|
||||
|
||||
@@ -7,15 +7,6 @@ class XmlObject
|
||||
|
||||
private INDENT_SIZE = 2
|
||||
|
||||
function new()
|
||||
m.escapeChars = {}
|
||||
m.escapeChars["&"] = "&"
|
||||
m.escapeChars["<"] = "<"
|
||||
m.escapeChars[">"] = ">"
|
||||
m.escapeChars[`"`] = `"`
|
||||
m.escapeChars["'"] = "'"
|
||||
end function
|
||||
|
||||
function Node(name as string, attributes = invalid as object) as boolean
|
||||
newNode = {
|
||||
name: name
|
||||
@@ -92,9 +83,11 @@ class XmlObject
|
||||
end function
|
||||
|
||||
function XmlEscape(input as string) as string
|
||||
for each escChar in m.escapeChars
|
||||
input = input.replace(escChar, m.escapeChars[escChar])
|
||||
end for
|
||||
input = input.replace("&", "&")
|
||||
input = input.replace("<", "<")
|
||||
input = input.replace(">", ">")
|
||||
input = input.replace(`"`, """)
|
||||
input = input.replace("'", "'")
|
||||
return input
|
||||
end function
|
||||
|
||||
|
||||
Reference in new issue
Block a user