       formData.append key, @value(key)
 
     formData
+
+  urlEncoded: (action) =>
+    parser = document.createElement('a')
+    parser.href = action
+    params = parser.search.substring(1).split('&')
+
+    for key in @keys()
+      params.push "#{key}=#{@value(key)}"
+
+    if @form?
+      for element in @form.elements
+        unless element.hasAttribute('name')
+          continue
+
+        type = element.getAttribute("type").toUpperCase() || 'TEXT'
+        if (type != 'FILE' && type != 'RADIO' && type != 'CHECKBOX') || element.checked
+          params.push "#{encodeURIComponent(element.name)}=#{encodeURIComponent(element.value)}"
+
+    parser.search = "?#{params.join("&")}"
+    parser.href
 
 class Response
   constructor: (@xhr) ->

      throw "Cannot send a request to the server if the element isn't a Form or if the element doesn't have the HREF attributes: <div href>"
      return

    if /get/i.test(@method) && @data.any()
      parser = document.createElement('a')
      parser.href = action
      params = parser.search.substring(1).split('&')

      for key in @data.keys()
        params.push "#{key}=#{@data.value(key)}"

      parser.search = "?#{params.join("&")}"

      action = parser.href

    @request.open @method, action
    @request.setRequestHeader 'accept', "*/*;q=0.5, #{@script}"
    @request.setRequestHeader 'X-Requested-With', "XMLHttpRequest"

    if !/get/i.test(@method.test)
      token = document.querySelector('meta[name=csrf-token]').getAttribute('content')
      @request.setRequestHeader 'X-CSRF-Token', token

    @request.send(@data.serialize())


ObserveJS.XHR = XHR


    @method = el.getAttribute('method') || 'GET'

  open: (method, action) =>
    @request.open @method, action
    @request.setRequestHeader 'accept', "*/*;q=0.5, #{@script}"
    @request.setRequestHeader 'X-Requested-With', "XMLHttpRequest"

  send: =>
    action = @request.element.getAttribute('action') || @request.element.getAttribute('href')

