     @__call @__service.batch.endpoint
     , 
       data: tasks
-      headers:
-        Accept: 'application/json; charset=UTF-8'
-        'Content-Type': 'application/json'
+      headers: @defaultHeaders
     ,
       'POST'
     ,

    @__service = {}
    @_ready = false

    @defaultHeaders = Accept: "application/json", 'X-Stream': 'true'
    @defaultHeaders = _.extend @defaultHeaders, opts.headers if opts?.headers
    @defaultHeaders.Authorization = "Basic " + (new Buffer("#{opts.username}:#{opts.password}").toString('base64')) if opts.password and opts.username


    _eb = =>
      @emit 'batch', tasks
      tasks = []

    @on 'query', (task) => 
      task.to = task.to.replace @root, ''
      task.id ?= Math.floor(Math.random()*(999999999-1+1)+1)
