Created
August 10, 2016 18:19
-
-
Save blzjns/4016d4bb5c66c70ad7ac38a77d82dc2d to your computer and use it in GitHub Desktop.
akka http custom content type
This file contains hidden or 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
import akka.http.scaladsl.Http | |
import akka.http.scaladsl.client.RequestBuilding._ | |
val customContentType = ContentType(MediaType.customWithFixedCharset("binary", "octet-stream", HttpCharsets.`UTF-8`)) //Content-Type: binary/octet-stream | |
val someData = "{}" | |
//simple http call using above content type | |
Http().singleRequest( | |
Put("http://127.0.0.1:8080/someendpoint") | |
.withEntity(customContentType, someData) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment