Author Topic: Is it posible to send HTTP POST/GET requests from lua scripts ?  (Read 21505 times)

0 Members and 1 Guest are viewing this topic.

Offline Kanubach

  • Newbie
  • *
  • Posts: 9
  • Karma: +0/-1
Hi.

I would like to run a POST or GET (HTTP protocol) in a script lua, and get back data from an ouside website.

something like:

Code: [Select]
content = HTTPGet("http://www.mysite.com/script.php?x=0&y=1")
Is it possible in lua ?

Thank's.

PtokaX forum


Offline ATAG

  • Scripter
  • Double Ace
  • ******
  • Posts: 111
  • Karma: +14/-0
  • secret things
    • Metin2 Hungarian Forum
Re: Is it posible to send HTTP POST/GET requests from lua scripts ?
« Reply #1 on: 13 November, 2008, 17:35:01 »
Example:
Code: [Select]
http = require "socket.http"
result, statuscode, content = http.request("http://www.mysite.com/script.php?x=0&y=1")
More info: http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/http.html

Offline Kanubach

  • Newbie
  • *
  • Posts: 9
  • Karma: +0/-1
Re: Is it posible to send HTTP POST/GET requests from lua scripts ?
« Reply #2 on: 14 November, 2008, 18:29:27 »
Greats !
A lot of thanks...

PtokaX forum

Re: Is it posible to send HTTP POST/GET requests from lua scripts ?
« Reply #2 on: 14 November, 2008, 18:29:27 »