lide.http

[lide.http] ^0.2.1

The library lide.http allows us to do http / https (post, get, put, head, delete, etc …) from lua.

installation

To install this library use lide install.

$ lide install lide.http

dependencies

The following dependencies are necessary to be able to run the library:


http.download

Download the given “url” to “dest” path to the system.
nil http.download ( string Url, string DestPath, func_ downldCallback ( number Downlded, number DownldTotal, number Percent ) )

http.test_connection

Test HTTP or HTTPS connection.
nil http.test_connection ( string Url )

http requests

The second argument of a request is a table that can be used to make more advanced requests. Any request can be made with either a second argument or as a table.

table requestData = {
  table data,
  table headers,
  table proxy,
  number timeout,
  table auth,   --> result of requests.HTTPDigestAuth
  string cookies,
  bool allow_redirects = true,
}

http.get

The GET method requests a representation of a specific resource. Requests that use the GET method should only retrieve data.

http.head

The HEAD method requests an identical response to that of a GET request, but without the body of the response.
table http.head ( string Url, table requestData )

http.post

The POST method is used to send an entity to a specific resource, often causing a change in state or side effects on the server.
table http.post ( string Url, table requestData )

http.put

The PUT mode replaces all current representations of the destination resource with the payload of the request.
table http.put ( string Url, table requestData )

http.delete

The DELETE method deletes a specific resource.
table http.delete ( string Url, table requestData )

http.connect

The CONNECT method establishes a tunnel to the server identified by the resource.
table http.connect ( string Url, table requestData )

http.options

The OPTIONS method is used to describe the communication options for the destination resource.
table http.options ( string Url, table requestData )

http.trace

The TRACE method performs a message loopback test along the route to the destination resource.
table http.trace ( string Url, table requestData )

http.patch

The PATCH method is used to apply partial modifications to a resource.
table http.patch ( string Url, table requestData )