def exec(sock, ver, path)
if @uri
if @uri.port == @uri.default_port
self['host'] = @uri.host
else
self['host'] = "#{@uri.host}:#{@uri.port}"
end
end
if @body
send_request_with_body sock, ver, path, @body
elsif @body_stream
send_request_with_body_stream sock, ver, path, @body_stream
elsif @body_data
send_request_with_body_data sock, ver, path, @body_data
else
write_header sock, ver, path
end
end