We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When I using this package, I've no issue about Request body from json, but I got some issue when Request Form Data
When I send a request with form data, the data displays in string form
I have tried to override RequestLoggingInterceptor, but data still flows into RequestLoggingInterceptor
public class RequestLogging extends RequestLoggingInterceptor { private static final Logger LOGGER = LoggerFactory.getLogger(RequestLoggingInterceptor.class); public RequestLogging(ServerHttpRequest delegate, boolean logHeaders, String requestId) { super(delegate, logHeaders, requestId); } @Override public Flux<DataBuffer> getBody() { MediaType contentType = getDelegate().getHeaders().getContentType(); boolean isFormData = contentType != null && contentType.isCompatibleWith(MediaType.MULTIPART_FORM_DATA); boolean isJson = contentType != null && contentType.isCompatibleWith(MediaType.APPLICATION_JSON); if (isFormData) { LOGGER.info("Request: method={}, uri={}, payload={}, audit={}", getDelegate().getMethod(), getDelegate().getPath(), "[Form Data]", StructuredArguments.value("audit", true)); return super.getBody(); } else if (isJson) { return super.getBody().publishOn(Schedulers.boundedElastic()).map(dataBuffer -> { byte[] bytes = new byte[dataBuffer.readableByteCount()]; dataBuffer.read(bytes); DataBufferUtils.release(dataBuffer); String body = new String(bytes, StandardCharsets.UTF_8); LOGGER.info("Request: method={}, uri={}, payload={}, audit={}", getDelegate().getMethod(), getDelegate().getPath(), body, StructuredArguments.value("audit", true)); return dataBuffer; }); } else { LOGGER.info("Request: method={}, uri={}, unsupported content type={}, audit={}", getDelegate().getMethod(), getDelegate().getPath(), contentType, StructuredArguments.value("audit", true)); return super.getBody(); } } }
The text was updated successfully, but these errors were encountered:
Can you paste your request? What would you exactly like to see in the logs for your request?
Sorry, something went wrong.
iNitialM505
No branches or pull requests
When I using this package, I've no issue about Request body from json, but I got some issue when Request Form Data
When I send a request with form data, the data displays in string form
I have tried to override RequestLoggingInterceptor, but data still flows into RequestLoggingInterceptor
The text was updated successfully, but these errors were encountered: