We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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])
The text was updated successfully, but these errors were encountered:
I guess this question, more specifically, is how to decode an Entity to a case class via Circe.
Entity
Sorry, something went wrong.
Hey Devon! sorry for the late response...
Decoding an entity to a case class via circe can be done with the hammock-circe module. You can see an example here https://scastie.scala-lang.org/F5wqP0yNRTiDQPa73lQL4w
hammock-circe
As per getting the headers map, you can get them from the HttpResponse directly (response.headers)
HttpResponse
response.headers
No branches or pull requests
The docs make it pretty clear how to make a request and decode the entity of the HttpResponse:
And you can get the headers like:
But how could one decode the response and consume the headers and body into a case class like:
The text was updated successfully, but these errors were encountered: