code: function(self, callback){
                  if(this.errorType) return;
                  $.ajax({
                      dataType: this.dataType,
                      type: this.type,
                      url: this.url,
                      data: this.data,
                      contentType: this.contentType,
                      beforeSend: function(request){
                          if(self.headers){
                              $.map(self.headers, function (item){
                                  request.setRequestHeader(item.key, item.val);
                              });
                          }
                      },
                      success: function(data){
                          data.type = "ok";
                          self.callback(data);
                      },
                      error: function(xhr, textStatus, errorThrown){
                          var data = {
                              "type" : "error",
                              "xhr" : xhr,
                              "textStatus" : textStatus,
                              "errorThrown" : errorThrown
                          }
                          self.callback(data);
                      },
                      timeout: this.timeout
                  });
              }
docs: make request