$Module curl 3 cURL bindings for Varnish $Event event_function # GET the URL in the first parameter $Function VOID get(PRIV_TASK, STRING) # HEAD the URL in the first parameter $Function VOID head(PRIV_TASK, STRING) # Compatibility name for get $Function VOID fetch(PRIV_TASK, STRING) # POST the URL in the first parameter with the body fields given in # the second $Function VOID post(PRIV_TASK, STRING, STRING) # Return the header named in the first argument $Function STRING header(PRIV_TASK, STRING) # Free the memory used by headers. Not needed, will be handled # automatically if it's not called. $Function VOID free(PRIV_TASK) # The HTTP status code $Function INT status(PRIV_TASK) $Function STRING error(PRIV_TASK) # A response body can contain chars that are not allowed into headers, # e.g. CRLF. If the response body is a binary and/or it contains any # special chars, then this funtion MUST be used via synthetic: # synthetic(curl.body()). Otherwise it can be assigned to a header # resp.http.x-body = curl.body(); # Test 12 for a complete example. $Function STRING body(PRIV_TASK) # set_timeout and set_connect_timeout are not # global, but per request functions, therefore # they can't be used in vcl_init. $Function VOID set_timeout(PRIV_TASK, INT) $Function VOID set_connect_timeout(PRIV_TASK, INT) $Function VOID set_ssl_verify_peer(PRIV_TASK, INT) $Function VOID set_ssl_verify_host(PRIV_TASK, INT) $Function VOID set_ssl_cafile(PRIV_TASK, STRING) $Function VOID set_ssl_capath(PRIV_TASK, STRING) $Function STRING escape(STRING) $Function STRING unescape(STRING) # Add / Remove request headers $Function VOID header_add(PRIV_TASK, STRING) $Function VOID header_remove(PRIV_TASK, STRING) # Add all request headers from the req (or bereq) object $Function VOID header_add_all(PRIV_TASK) $Function VOID proxy(PRIV_TASK, STRING) $Function VOID set_proxy(PRIV_TASK, STRING) $Function VOID set_method(PRIV_TASK, STRING) $Function VOID set_unix_path(PRIV_TASK, STRING) $Function VOID set_debug(PRIV_TASK, ENUM { none, text, header_in, header_out, data_in, data_out })