Scroll to navigation

vmod_curl(3) Library Functions Manual vmod_curl(3)

Name

vmod_curl - cURL bindings for Varnish

SYNOPSIS

import curl [as name] [from "path"]
VOID get(STRING)
VOID head(STRING)
VOID fetch(STRING)
VOID post(STRING, STRING)
STRING header(STRING)
VOID free()
INT status()
STRING error()
STRING body()
VOID set_timeout(INT)
VOID set_connect_timeout(INT)
VOID set_ssl_verify_peer(INT)
VOID set_ssl_verify_host(INT)
VOID set_ssl_cafile(STRING)
VOID set_ssl_capath(STRING)
STRING escape(STRING)
STRING unescape(STRING)
VOID header_add(STRING)
VOID header_remove(STRING)
VOID header_add_all()
VOID proxy(STRING)
VOID set_proxy(STRING)
VOID set_method(STRING)
VOID set_unix_path(STRING)
VOID set_debug(ENUM)


# GET the URL in the first parameter

VOID get(STRING)

# HEAD the URL in the first parameter

VOID head(STRING)

# Compatibility name for get

VOID fetch(STRING)

# POST the URL in the first parameter with the body fields given in # the second

VOID post(STRING, STRING)

# Return the header named in the first argument

STRING header(STRING)

# Free the memory used by headers. Not needed, will be handled # automatically if it's not called.

VOID free()

# The HTTP status code

INT status()

STRING error()

# 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.

STRING body()

# set_timeout and set_connect_timeout are not # global, but per request functions, therefore # they can't be used in vcl_init.

VOID set_timeout(INT)

VOID set_connect_timeout(INT)

VOID set_ssl_verify_peer(INT)

VOID set_ssl_verify_host(INT)

VOID set_ssl_cafile(STRING)

VOID set_ssl_capath(STRING)

STRING escape(STRING)

STRING unescape(STRING)

# Add / Remove request headers

VOID header_add(STRING)

VOID header_remove(STRING)

# Add all request headers from the req (or bereq) object

VOID header_add_all()

VOID proxy(STRING)

VOID set_proxy(STRING)

VOID set_method(STRING)

VOID set_unix_path(STRING)

VOID set_debug(ENUM)

VOID set_debug(

ENUM {none, text, header_in, header_out, data_in, data_out} )