Skip to content

Documentation Request: How to consume response and headers in one request. #128

Open
@DevonPeroutky

Description

@DevonPeroutky

The docs make it pretty clear how to make a request and decode the entity of the HttpResponse:

  val response = Hammock
    .request(Method.GET, uri"https://api.fidesmo.com/apps", Map())
    .as[List[String]]
    .exec[IO]

And you can get the headers like:

  val response = Hammock
    .request(Method.GET, uri"https://api.fidesmo.com/apps", Map())
    .map(_.headers)
    .as[List[String]]
    .exec[IO]

But how could one decode the response and consume the headers and body into a case class like:

case class BodyAndHeaders[T](body: T, responseHeaders: Map[String, String])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions