module TeamCity::Request

Defines HTTP request methods

Public Instance Methods

delete(path, options={}, &block) click to toggle source

Perform an HTTP DELETE request

# File lib/teamcity/request.rb, line 20
def delete(path, options={}, &block)
  request(:delete, path, options, &block)
end
get(path, options={}, &block) click to toggle source

Perform an HTTP GET request

# File lib/teamcity/request.rb, line 5
def get(path, options={}, &block)
  request(:get, path, options, &block)
end
post(path, options={}, &block) click to toggle source

Perform an HTTP POST request

# File lib/teamcity/request.rb, line 10
def post(path, options={}, &block)
  request(:post, path, options, &block)
end
put(path, options={}, &block) click to toggle source

Perform an HTTP PUT request

# File lib/teamcity/request.rb, line 15
def put(path, options={}, &block)
  request(:put, path, options, &block)
end

Private Instance Methods

request(method, path, options, &block) click to toggle source

Perform an HTTP request

# File lib/teamcity/request.rb, line 27
def request(method, path, options, &block)
  response = connection(options).send(method) do |request|
    block.call(request) if block_given?
    request.url(path)
  end
  response.body
end