Инструменты пользователя

  • Зашли как Anonymous (Anonymous)
  • Выйти

Инструменты сайта


mantis:simpletv:api:http

Http

sessionId = New(UserAgent - str(opt),Proxy - str(opt),needRawHeaders - boolean(opt))

Close(sessionId)

str = GetCookies(sessionId,ServerUrl - str,CookieName - str(opt))

SetTimeout(sessionId,timeInMs)

string = GetRawHeader(sessionId)

number,string = GetLastError(sessionId)

SetRedirectAllow(sessionId,Enable - boolean)

boolean = RequestA(sessionId,Param - table)

execute async query
Param - same as  for Request with additional fields
Param.callback   - string
Param.uservalue -  any lua data, except function
Param.userstring - string (deprecated)
--callback function
function luaCallback(sessionId,rc,answer,uservalue)
end

rc,answer = Request(sessionId,Param - table)

execute sync query
rc     - http status code (number)
answer - data (string)
Param.url    - string
Param.method - string ("get","post","head"; optional, by default "get")
Param.headers - string (optional, by default empty)
Param.body    - string (optional, by default empty)
Param.writeinfile - boolean (optional, by default false)
Param.filename    - string (optional, by default empty(auto - return in answer))
Param.useProxyFromConfig -  boolean (optional, by default true)

RequestCancel(sessionId)

SetProxy(sessionId,Proxy - string)

boolean = IsProxy(sessionId)

mantis/simpletv/api/http.txt · Последние изменения: 2020/04/02 13:11 — SergeyVS