I am querying a search api and I need to add the query params in json as body to a post request.
val headers: scala.collection.immutable.Seq[HttpHeader] = scala.collection.immutable.Seq(
RawHeader("accept", "application/json"),
RawHeader("authorization", "xxxxxxxxxxxxxxxxxxxx"),
RawHeader("content-type", "application/json"),
RawHeader("x-customer-id", "123456789")
)
val formData = FormData(Map(
"Keywords" -> "query", "Count" -> "25"
))
val request = HttpRequest(HttpMethods.POST, "https://api.xxx.com/services/xxx/v1/search?client_id=xxxxxx", headers, formData.toEntity)
Will using formData.toEntity
send it as json in body of the post?