# File lib/em-twitter/request.rb, line 15 def to_s content = query data = [] data << "#{request_method} #{request_uri} HTTP/1.1" data << "Host: #{@options[:host]}" if gzip? data << 'Connection: Keep-Alive' data << 'Accept-Encoding: deflate, gzip' else data << 'Accept: */*' end data << "User-Agent: #{@options[:user_agent]}" if @options[:user_agent] if put_or_post? data << "Content-Type: #{@options[:content_type]}" data << "Content-Length: #{content.bytesize}" end data << "Authorization: #{oauth_header}" if oauth? data << "Authorization: #{basic_auth_header}" if basic_auth? data << "Proxy-Authorization: Basic #{proxy.header}" if proxy? @options[:headers].each do |name, value| data << "#{name}: #{value}" end data << "\r\n" data = data.join("\r\n") data << content if post? || put? data end
Generated with the Darkfish Rdoc Generator 2.