varnish / libvmod-curl

cURL Varnish bindings by Varnish Software
Other
48 stars 39 forks source link

Add custom request method #7

Closed chino closed 11 years ago

chino commented 11 years ago

This should take care of issue #5.

Basically adds a new custom_method( STRING ) function that accepts the method you would like to send instead of the standard GET/HEAD/POST.

After running it you still have to call the normal get/head/post methods since that defines which code path libcurl will take per the docs.

See CURLOPT_CUSTOMREQUEST on http://curl.haxx.se/libcurl/c/curl_easy_setopt.html

Example:

# send a PURGE request
# libcurl will use still perform a normal get()
# but use PURGE as the request method
curl.custom_method("PURGE");
curl.get("http://example.com/uri");
lolautruche commented 11 years ago

+1

chino commented 11 years ago

No comments on why this was closed?