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

spice.http.HttpExchange.scala Maven / Gradle / Ivy

There is a newer version: 0.8.0
Show newest version
package spice.http

import cats.effect.IO
import spice.store.{MapStore, Store}

case class HttpExchange(request: HttpRequest,
                        response: HttpResponse = HttpResponse(),
                        store: Store = new MapStore(),
                        finished: Boolean = false) {
  def modify(f: HttpResponse => IO[HttpResponse]): IO[HttpExchange] = {
    f(response).map(r => copy(response = r))
  }

  def finish(): HttpExchange = copy(finished = true)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy