add protocol.RequestBuffer api
This commit is contained in:
parent
b19cfba98e
commit
9eac8ef266
9 changed files with 144 additions and 0 deletions
|
@ -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) ->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue