HttpLoggingInterceptor logs multipart form data
See original GitHub issueOkHttp: 3.10.0
I upload images using multiparts.
The HttpLoggingInterceptor always prints the image contents:
Content-Disposition: form-data; name="description"
Content-Transfer-Encoding: binary
Content-Type: image/webp
Content-Length: 722
RIFF�����WEBPVP8 �����0Q���* �>�N�N%�#� ����in�wa@ ��l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�j������0K�������������������������������������������������������������������������
--d107e2ae-1b8d-4fbc-9bb1-ed210f622a45
Content-Disposition: form-data; name="image"; filename="203974559109715.webp"
Content-Type: image/webp
Content-Length: 722
RIFF�����WEBPVP8 �����0Q���* �>�N�N%�#� ����in�wa@ ��l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�l����9}�r�d�=���{퓐��'!�NC�j������0K�������������������������������������������������������������������������
--d107e2ae-1b8d-4fbc-9bb1-ed210f622a45--
It would be great if this binary data could be omitted.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:10
- Comments:5 (1 by maintainers)
Top Results From Across the Web
How do I stop OkHttp from logging multipart/form-data ...
I'd create my own logging interceptor (possibly forking off HttpLoggingInterceptor ) that logs body conditional to Content-Type header value. – ...
Read more >Retrofit 2 — Log Requests and Responses - Future Studio
Retrofit 1 integrated a log feature for basic request and response ... D/HttpLoggingInterceptor$Logger: Content-Disposition: form-data; ...
Read more >Java – HttpLoggingInterceptor for http request & response logging
I'm using retrofit2 and I need to log all request and response. Request and response works perfectly, All I need is to log...
Read more >How to use HTTPClient for a multipart/form-data upload?
In out Godot 3.1 project, we are trying to use the HTTPClient class to upload a file to a server. (A self-hosted Seafile...
Read more >Consuming APIs with Retrofit | CodePath Android Cliffnotes
This library makes downloading JSON or XML data from a web API fairly ... If we need to upload images or files, we...
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
Is this still on the roadmap? The issue is flagged
3.12
, but4.4.0
was released this week and the issue is still present. 😦HttpLoggingInterceptor is not actively improved, but is maintained. Probably deserves a separate project.