-
Notifications
You must be signed in to change notification settings - Fork 294
feat: add request body logging for HTTP imposters #837
New issue
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
base: master
Are you sure you want to change the base?
Conversation
Include request body in HTTP imposter logs when body is present. This enhances debugging capabilities by showing the complete request data sent to mocked endpoints in the logs.
Include request body in HTTP imposter logs when body is present. This enhances debugging capabilities by showing the complete request data sent to mocked endpoints in the logs.
|
What would happen if the body is a 10MB jpg image? That is, uploading a 10MB jpg image. |
|
@jarl-dk Good catch! You're absolutely right about large binary content. I should handle this edge case. Here are two approaches: Option 1 - Size limit: Option 2 - Content-type detection: I'm leaning towards Option 1 as it's simpler and handles all content types universally. What do you think? |
|




Summary
Changes
src/models/http/baseHttpServer.jsto log request body alongside method and URLExample
Before:
[http:4000 api-mock] ::1:57888 => POST /api/endpoint
After:
[http:4000 api-mock] ::1:57888 => POST /api/endpoint body: {"key":"value","data":"test"}
Testing
This enhancement improves debugging experience by showing complete request information in imposter logs.