lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Thu, Jan 22, 2015 at 4:32 AM, Choonster TheMage <> wrote:
On 22 January 2015 at 07:29, Gordon Madarm <> wrote:

This is an example of how you'd create the table for request_pipeline:

-- Assumes that file_with_paths.txt contains one path on each line

local request = {} -- The request table to pass to httpc:request_pipeline
local currentKey = 0 -- The most recent key an inner params table was stored at

for line in io.lines("file_with_paths.txt") do
currentKey = currentKey + 1 -- Increment currentKey
request[currentKey] = { path = line } -- Store a params table at currentKey

httpc:request_pipeline(request) -- Make the request

Thanks! One follow up question, the documentation uses the httpc:request_pipeline{} syntax, while you use  httpc:request_pipeline(). What is the difference between curly brackets and circle brackets here?