[luci] How to instantiate a Request object

Bryan Mayland bmayland at leoninedev.com
Wed Aug 22 14:05:27 CEST 2012


On 8/21/2012 10:47 PM, Duy Nguyen wrote:
>
> I want to write a module which has a function named "check_ip", which 
> will go through a list of Facebook IPs to check if there is any IP is 
> not used to delete it from the list. I used 
> "luci.lucid.http.handler.luci" module and its function 
> "handle_GET(request)". But I received an error: "attempt to index 
> local 'env' (a nil value)". I know that I have to give the 
> "handle_GET" function a Request object, but I don't know how to create 
> that one.
luci.lucid.http is for incoming HTTP requests (as well as some protocol 
helpers). To make outgoing HTTP requests, use the luci.httpclient 
module's functions such as request_to_buffer().


More information about the luci mailing list