io.laminext.fetch.upickle.JsonToRequestBody.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fetch-upickle_sjs1_3 Show documentation
Show all versions of fetch-upickle_sjs1_3 Show documentation
Laminar utilities and components
package io.laminext.fetch
package upickle
import org.scalajs.dom.experimental.BodyInit
import scala.scalajs.js
import scala.scalajs.js.UndefOr
class JsonToRequestBody(jsonStr: String) extends ToRequestBody {
override def apply(): UndefOr[BodyInit] = jsonStr
override def updateHeaders(headers: js.UndefOr[Map[String, String]]): js.UndefOr[Map[String, String]] =
headers.getOrElse(Map.empty).updated("content-type", "application/json; charset=utf-8")
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy