Created
November 1, 2011 12:07
-
-
Save natritmeyer/1330393 to your computer and use it in GitHub Desktop.
HTTP Purge, for use with Varnish
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rest-client' | |
class Net::HTTP::Purge < Net::HTTPRequest | |
METHOD = 'PURGE' | |
REQUEST_HAS_BODY = false | |
RESPONSE_HAS_BODY = true | |
end | |
module RestClient | |
def self.purge(url, headers={}, &block) | |
Request.execute(:method => :purge, :url => url, :headers => headers, &block) | |
end | |
end | |
#allows: | |
RestClient.purge "http://www.example.com/purge_me_please" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment