IgorTimofeev / MineOS

Home of MineOS and it's software for OpenComputers mod
Other
759 stars 188 forks source link

post request #442

Closed ArtyomKor closed 2 years ago

ArtyomKor commented 2 years ago

Как правильно отправить пост запрос с несколькими данными?

Например: login: "admin" pass: "admin" var: null

IgorTimofeev commented 2 years ago
local internet = require("internet")

-- Вариант 1
local response = internet.request("http://example.com/", "login=admin&pass=admin&var=null")

-- Вариант 1, если впадлу юзать амперсанды
local response = internet.request("http://example.com/", internet.serialize({
  login = "admin",
  pass = "admin",
  var = "null"
}))