Skip to content

Instantly share code, notes, and snippets.

@olix0r
Created October 27, 2015 23:44
Show Gist options
  • Save olix0r/e8eb6c34bfd3a1ae51b3 to your computer and use it in GitHub Desktop.
Save olix0r/e8eb6c34bfd3a1ae51b3 to your computer and use it in GitHub Desktop.
package com.twitter.finagle.httpx
import org.jboss.netty.handler.codec.http.multipart.HttpPostRequestEncoder
/**
* A goddamned awful hack.
*/
object PostRequestEncoder {
def encode(req: Request, params: Seq[(String, String)]): Unit = {
val enc = new HttpPostRequestEncoder(req.httpRequest, false)
for ((k, v) <- params) {
enc.addBodyAttribute(k, v)
}
enc.finalizeRequest()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment