Search
Setup for Free
N
Nuxt
•
2y ago
Kotkoroid
Get body of the response
I
'm trying to get the body of the response through H3
.
readBody()
readBody()
is only for request body
. How do I get the one from response
?
Nuxt
Join
Nuxt Community Chat Server
31,885
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
M
manniL
•
7/12/24, 3:25 PM
@w7a9q what do you mean with
"the reponse body
"
?
M
manniL
@w7a9q what do you mean with "the reponse body"?
K
Kotkoroid
OP
•
7/12/24, 4:08 PM
HTTP response body
K
Kotkoroid
HTTP response body
M
manniL
•
7/12/24, 4:15 PM
I got that
. but of which response
?
M
manniL
•
7/12/24, 4:15 PM
Can you show some code
M
manniL
•
7/12/24, 4:16 PM
Because at the point when you read the body
, it is always the body of the request some client sent to the nitro endpoint
M
manniL
Because at the point when you read the body, it is always the body of the reques...
K
Kotkoroid
OP
•
7/12/24, 5:52 PM
Yeah but you can use middleware to manipulate with the response as well
, right
? I don
't have any code
. I want to write a middleware and read the body of the response I return back from endpoint implemented in the
server/api
server/api
.
K
Kotkoroid
Yeah but you can use middleware to manipulate with the response as well, right? ...
M
manniL
•
7/12/24, 7:33 PM
ah
, so a middleware
after
handling the request then
?
M
manniL
•
7/12/24, 7:33 PM
What is the use case if I may ask
M
manniL
What is the use case if I may ask
K
Kotkoroid
OP
•
7/14/24, 8:04 AM
The client wants us to verify that the actual response body is JSON
.
K
Kotkoroid
The client wants us to verify that the actual response body is JSON.
M
manniL
•
7/14/24, 8:30 AM
https://nitro.unjs.io/guide/plugins#available-hooks
Plugins - Nitro
Use plugins to extend Nitro
's runtime behavior
.
M
manniL
•
7/14/24, 8:30 AM
check out beforeResponse
K
Kotkoroid
OP
•
7/14/24, 10:01 AM
Great
! Thanks
Similar Threads
Response Body in Error with useFetch
N
Nuxt / ❓・help
2y ago
Can serverMiddleware in nuxt3 modify the body of request?
N
Nuxt / ❓・help
12mo ago