JSON Trouble

Learn how to implement the routes and find a workaround for the http4s error.

We'll cover the following...

Broken JSON

Now that we have a proper streaming solution, we can try it out.

What do we get when we expect a list of products?

The http command is from the tool httpie19 for querying our service.

Press + to interact
% http :53248/products
HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
{
"id":"8773899b-fcfa-401f-af3e-b188ebb0c00c",
"names":[
{"lang":"de","name":"Erdbeere"},
{"lang":"en","name":"Strawberry"}
]
}
{
"id":"983aaf86-abe4-44af-9896-d8f2d2c5f82c",
"names":[
{"lang":"de","name":"Gurke"},
{"lang":"en","name":"Cucumber"}
]
}

Well, ...

Access this course and 1400+ top-rated courses and projects.