def set_request_headers!(request)
      case @request_format
      when :json
        request.initialize_http_header 'Content-Type' => 'application/json'
        request.initialize_http_header 'Content-length' => '0' unless @body
      when :file
        request.initialize_http_header 'Content-Length' => @body.size.to_s
        request.initialize_http_header 'Transfer-Encoding' => 'chunked'
      end
      @headers['User-Agent'] = 'Yt::Request (gzip)'
      @headers['Authorization'] = "Bearer #{@auth.access_token}" if @auth
      @headers.each{|name, value| request.add_field name, value}
    end
def set_request_headers!(request)
      case @request_format
      when :json
        request.initialize_http_header 'Content-Type' => 'application/json'
        request.initialize_http_header 'Content-length' => '0' unless @body
      when :file
        request.initialize_http_header 'Content-Length' => @body.size.to_s
        request.initialize_http_header 'Transfer-Encoding' => 'chunked'
      end
      @headers['User-Agent'] = 'Yt::Request (gzip)'
      @headers['Authorization'] = "Bearer #{@auth.access_token}" if @auth
      @headers.each{|name, value| request.add_field name, value}
    end
Adds the request headers to the request in the appropriate format.
 The User-Agent header is also set to recognize the request, and to
 tell the server that gzip compression can be used, since Net::HTTP
 supports it and automatically sets the Accept-Encoding header.