def set_request_headers!(request)
      if @request_format == :json
        request.initialize_http_header 'Content-Type' => 'application/json'
      end
      @headers.each do |name, value|
        request.add_field name, value
      end
    end
def set_request_headers!(request)
      if @request_format == :json
        request.initialize_http_header 'Content-Type' => 'application/json'
      end
      @headers.each do |name, value|
        request.add_field name, value
      end
    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.