Created
November 9, 2011 21:15
-
-
Save dwestheide/1353058 to your computer and use it in GitHub Desktop.
Byte array support for Dispatch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def <<< (bytes: Array[Byte], content_type: String): Request = { | |
val e = new org.apache.http.entity.ByteArrayEntity(bytes) | |
e.setContentType(content_type) | |
PUT.copy(body = Some(e)) | |
} | |
def << (bytes: Array[Byte], content_type: String): Request = { | |
val e = new org.apache.http.entity.ByteArrayEntity(bytes) | |
e.setContentType(content_type) | |
POST.copy(body = Some(e)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment