add protocol.RequestBuffer api

This commit is contained in:
deepak1556 2015-03-16 18:23:45 +05:30
parent b19cfba98e
commit 9eac8ef266
9 changed files with 144 additions and 0 deletions

View file

@ -16,6 +16,16 @@ class RequestStringJob
@charset = charset ? 'UTF-8'
@data = String data
protocol.RequestBufferJob =
class RequestBufferJob
constructor: ({mimeType, encoding, data}) ->
if not data instanceof Buffer
throw new TypeError('Data should be Buffer')
@mimeType = mimeType ? 'application/octet-stream'
@encoding = encoding ? 'utf8'
@data = new Buffer(data)
protocol.RequestFileJob =
class RequestFileJob
constructor: (@path) ->