Fork me on GitHub
#reitit
<
2021-05-05
>
matheusashton01:05:00

Hi, I'm using ring-jetty-adapter with reitit.ring and muuntaja to handle json requests, but after configuring:

{:data {:muuntaja m/instance
                        ;; :coercion schema/coercion
                        :middleware [ring.middleware.reload/wrap-reload
                                     muuntaja/format-middleware
                                     ;; reitit.ring.coercion/coerce-request-middleware
                                     ;; reitit.ring.coercion/coerce-response-middleware
                                     [wrap-deps deps]]}
and printing a request body, I'm getting
#object[org.eclipse.jetty.server.HttpInputOverHTTP 0x378295b6 "HttpInputOverHTTP@378295b6[c=36,q=0,[0]=null,s=STREAM]"]
am I doing something wrong?

matheusashton01:05:08

I should be receiving a map converted from request's json body right?

Michaël Salihi12:05:44

Hi @matheusashton You can find the decoded request body in :body-params. From the format-middleware docstring: > if the :body-params doesn't already exist. Decodes the request body into :body-params using the :muuntaja/request key in request

🙌 3
kenny15:05:57

I am using muuntaja for request and response content type negotiation. Is there a built-in or recommended way to return a nice error if the content-type header is not specified or specifies an unsupported type?

West21:05:53

Hey guys, I need some help. I’m trying to use reitit frontend, but for some reason, when I click on a link, the url updates, but the page doesn’t change. Why could that be?

West21:05:57

This seems to work just fine, but my code won’t work. I feel like it might be obvious, but I’ve been so stumped by this problem.

West15:05:49

I figured it out. I needed to put app in line 191 into [] square brackets.

👍 3