question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HttpLoggingInterceptor logs multipart form data

See original GitHub issue

OkHttp: 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:closed
  • Created 5 years ago
  • Reactions:10
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
eric-labellecommented, Feb 20, 2020

Is this still on the roadmap? The issue is flagged 3.12, but 4.4.0 was released this week and the issue is still present. 😦

0reactions
yschimkecommented, Mar 29, 2020

HttpLoggingInterceptor is not actively improved, but is maintained. Probably deserves a separate project.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found