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.

How to use ContentEncoding?

See original GitHub issue

I setup client like here:

HttpClient {
    ContentEncoding()
}

But I still cannot read request (using call.content) with Accept-Encoding: gzip, I don’t see normal text, just some binary data. What do I need to do to read decoded text through ByteReadChannel?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
rsinukovcommented, Sep 14, 2020

Property content of HttpResponse is a raw response from the server, that is not modified by HttpResponsePipeline. To get modified content, please use the receive function. Example

        client.get<HttpStatement>(url).execute { response ->
            val content = response.receive<String>()
        }

I updated the doc here to make it more visible

0reactions
oleg-larshincommented, Aug 10, 2020

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Content-Encoding - HTTP - MDN Web Docs
The Content-Encoding representation header lists any encodings that have been applied to the representation (message payload), and in what ...
Read more >
HTTP headers | Content-Encoding - GeeksforGeeks
The HTTP headers Content-encoding is used to compress the media type. It informers the server which encoding the user will supported. It sends ......
Read more >
Content-Encoding HTTP Header: Syntax, Directive, Examples
The Content-Encoding HTTP Header specifies which encoding was used to encode the representation and in what order. The Content-Encoding HTTP ...
Read more >
HttpRequest.ContentEncoding Property (System.Web)
An Encoding object representing the client's character set. Examples. The following code example assigns a value representing the description of the current ...
Read more >
Content Encoding: why and how to use the meta charset tag ...
To make sure of the information transmitted through the page metadata, you can use our Timeline / Waterfall feature. Unfold the detailed values ......
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