Skip to content

Commit

Permalink
Use urlencode to encode logs
Browse files Browse the repository at this point in the history
  • Loading branch information
hellozepp committed Sep 7, 2021
1 parent ec33517 commit 22c6eb1
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

package tech.mlsql.log

import org.apache.http.client.fluent.Request
import org.apache.http.client.fluent.{Form, Request}
import org.apache.http.entity.ContentType
import org.apache.spark.SparkEnv
import streaming.log.WowLog
Expand All @@ -44,8 +44,8 @@ trait BaseHttpLogClient extends Logging with WowLog {
val token = _conf.getOrElse("spark.mlsql.log.driver.token", "mlsql")
iter.foreach { line =>
val body = SendLog(token, LogUtils.formatWithOwner(line, owner, groupId)).json
Request.Post(url).bodyString(body, ContentType.APPLICATION_JSON.withCharset("utf8"))
.addHeader("Content-Type", "application/x-www-form-urlencoded")
Request.Post(url).addHeader("Content-Type", "application/x-www-form-urlencoded")
.bodyForm(Form.form().add(body, null).build())
.execute()
}

Expand Down

0 comments on commit 22c6eb1

Please sign in to comment.