U
Size: a a a
U
U
LU
S
S
U
S
IN
U
S
function makeRequest(listener, url, body, headers)
local params = {headers = headers, body = body)
network.request(url, body and "POST" or "GET", listener, params )
end
local function listener(event)
if event.phase == "ended" then
print("Has error? " .. tostring(event.isError))
print("Response: " .. tostring(event.response))
end
end
makeRequest(listener, "https://anotepad.com/api")
S
S
IN
S
S
curl user:pass -x PUT -d "id=488&title=Updated title&content=Content goes here." https://anotepad.com/api/notes
?S
local url = "https://anotepad.com/api/notes"
local verb = "PUT"
local params = {
body = "id=488&title=Updated title&content=Content goes here.",
headers = {
Authorization = "Basic " .. base64.encode("user:pass")
}
}
network.request(url, verb, listener, params)
Для base64.encode дёрни хоть эту штуку: S
か.
AZ