This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
minionlib [2020/12/14 08:15] – [HTTPRequest] frenkey | minionlib [2021/01/17 20:19] – Response headers string to table example kali | ||
---|---|---|---|
Line 252: | Line 252: | ||
local function success(str, | local function success(str, | ||
d(" | d(" | ||
- | d(" | + | d(" |
d(" | d(" | ||
Line 260: | Line 260: | ||
| | ||
end | end | ||
+ | | ||
+ | local function HeadersTable(header) | ||
+ | if type(header) == " | ||
+ | header = string.match(header," | ||
+ | local tbl = {} | ||
+ | for w in header: | ||
+ | local k,v = string.match(w," | ||
+ | | ||
+ | end | ||
+ | table.print(tbl) | ||
+ | return tbl | ||
+ | end | ||
+ | end | ||
+ | | ||
+ | header = HeadersTable(header) -- if you want to convert the header string to a table | ||
end | end | ||
Line 272: | Line 287: | ||
path = "/ | path = "/ | ||
port = 443, | port = 443, | ||
- | method = " | + | method = " |
https = true, | https = true, | ||
onsuccess = success, | onsuccess = success, | ||
Line 278: | Line 293: | ||
getheaders = true, --true will return the headers, if you dont need it you can leave this at nil | getheaders = true, --true will return the headers, if you dont need it you can leave this at nil | ||
body = "", | body = "", | ||
- | headers = "" | + | headers = {}, --optional, if not required for your call can be nil or "" |
} | } | ||