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

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

There is a newer version: 2.9.0
Show newest version
package io.laminext.fetch.jsoniter

import org.scalajs.dom.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 - 2024 Weber Informatics LLC | Privacy Policy