boundary = "--61141483716826"
contenttype = "multipart/form-data; boundary=" .. boundary
filepath = "/cat.jpg"
mes = "--".. boundary .. "\r\n"
.."Content-Disposition: form-data; name=\"image\"; filename=\"cat.jpg\"\r\n"
.."Content-Type: image/jpeg\r\n"
.."\r\n"
.."<!--WLANSDFILE-->\r\n"
.."--" .. boundary .. "--\r\n"
blen = lfs.attributes(filepath, "size") + string.len(mes) - 17
b, c, h = fa.request{url = "http://example.com",
method = "POST",
headers = {["Authorization"] = "Basic user:passwordをBase64した値",
["Content-Length"] = tostring(blen),
["Content-Type"] = contenttype},
file = filepath,
body = mes
}
print(b)
print("\n")