how to log entire response (at least statusCode & body)
See original GitHub issueI’m trying to correlate the response statusCode with the response body.
How can I get a log of the body & the statusCode? I attempted this:
...blah
scenarios:
- name: POST /foo
flow:
...blah
- post:
url: "/foo"
capture:
- json: "$"
as: fooBody
...blah
- log: "{{statusCode}} => {{ fooBody }}"
Obviously statusCode
logs as undefined
. The fooBody
works.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Spring Boot - How to log all requests and responses with ...
If you want the headers to be included in the log, then you should add: "spring.http.log-request-details=true" to you application.properties file. – jfajunior.
Read more >How to Get Response Body When Testing the Status Code in ...
In this tutorial, we'll look at how to access the status code and response body returned from a REST request using WebFlux's WebClient....
Read more >Response.status - Web APIs - MDN Web Docs
The status read-only property of the Response interface contains the HTTP status codes of the response.
Read more >How to Read Json Response Body using Rest Assured?
restassured.response.ResponseBody. This class represents the Body of a received Response. Using this class you can get and validate complete or ...
Read more >REST Assured Tutorial 69 – Response Logging In Rest Assured
all () – Logs everything in the response, including e.g. headers, cookies, body. Pretty-prints the body if content-type is either either XML, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If you add
processor: "./my-functions.js"
into your test.yml files config then addafterResponse: "printStatus"
to your call in the flow likethen in the my-functions.js file add a
make sure in the file you include
Yeah, I discovered earlier this week that
DEBUG=http:response
doesn’t actually print out the HTTP response status code. That’s the single most important part of any response, in my opinion.