Created
October 27, 2015 23:44
-
-
Save olix0r/e8eb6c34bfd3a1ae51b3 to your computer and use it in GitHub Desktop.
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
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