All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.laminext.fetch.upickle.JsonToRequestBody.scala Maven / Gradle / Ivy

There is a newer version: 0.17.0
Show newest version
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