luafan

fan.http

escape(str:string)

call to curl_escape

unescape(str:string)

call to curl_unescape

cookiejar(path:string)

set the default cookiejar path

cainfo(path:string)

set the default cainfo path

capath(path:string)

set the default capath path

get(arg:table or string)

post(arg:table or string)

put(arg:table or string)

head(arg:table or string)

update(arg:table or string)

delete(arg:table or string)


if arg is string, use it as url key in the following arg table.


keys in the arg:


Worker and concurrency

The Lua fan.http.http implementation accepts worker and forwards it to fan.connector.tcp, so its request connection uses the selected event base: omitted keeps the connection on the main base, while an explicit worker selects that worker. This applies to the Lua HTTP implementation only.

The core fan.http client (C implementation) now owns one libcurl multi handle, timer events, socket events and in-flight list per event runtime: the main base plus one runtime per event worker. It accepts worker with these rules:

The curl_share handle (DNS/SSL session/connect cache) is still process-wide and is serialized by its own recursive lock.

responsetable


keys in the responsetable: