Enable customing mime type and charset when returning reqeust string job.

This commit is contained in:
Cheng Zhao 2013-08-25 15:07:07 +08:00
parent 912bac698c
commit 1ed77371c0
3 changed files with 27 additions and 2 deletions

View file

@ -1 +1,11 @@
module.exports = process.atomBinding 'protocol'
module.exports.RequestStringJob =
class RequestStringJob
constructor: ({mimeType, charset, data}) ->
if typeof data isnt 'string' and not data instanceof Buffer
throw new TypeError('Data should be string or Buffer')
@mimeType = mimeType ? 'text/plain'
@charset = charset ? 'UTF-8'
@data = String data