Questions tagged [content-encoding]

Use this tag for questions regarding specifying content encoding on HTTP requests.

A concept in HTTP/1.1 content negotiation to indicate encryption or compression of an HTTP response (such as gzip support).

The following headers are typically used to determine the content encoding of a response. However, servers are free to use other aspects they choose.

  • Accept
  • Accept-Charset
  • Accept-Encoding
  • Accept-Language
  • User-Agent

Typical values of the Transfer-Encoding header: gzip, compress, deflate, identity, *

155 questions
0
votes
1 answer

Unable to get Content Encoding using PHP cURL

I am using cURL with PHP to get content type and content encoding. I am successfully getting content type but content encoding value is empty. function get_content_type_curl($url_content_type) { $agent_content_type =…
Mehul Kumar
  • 461
  • 8
0
votes
0 answers

how do I implement in .net core Response.ContentEncoding = Encoding.GetEncoding("ISO-8859-1"); Response.Charset = "ISO-8859-1"; Response.Write(html);

Response.Clear(); Response.ContentEncoding = Encoding.GetEncoding("ISO-8859-1"); Response.HeaderEncoding = Encoding.GetEncoding("ISO-8859-1"); Response.Charset = "ISO-8859-1"; …
0
votes
0 answers

CloudFront decompress objects for viewers that don't support compression

I was looking at setting up an S3 origin with pre-compressed objects. This mostly work by setting the content-encoding on the object and CloudFront will forward the compressed object or even convert it from gzip to br. However it appears to have a…
Kevin Cox
  • 3,080
  • 1
  • 32
  • 32
0
votes
0 answers

Options to be used with zlib module in Node.js to compress javascript files to be used with gzip encoding in browser

I am using Node.js as a HTTP server. I do not use the Express module. I want to compress a javascript file, send the resulting string after setting headers in the middleware, as in: zlib = require ("zlib"); res.setHeader('Content-Encoding',…
Sunny
  • 9,245
  • 10
  • 49
  • 79
0
votes
1 answer

contentEncodingError when opening website in Firefox using selenium and python3

I'm trying to perform a fairly simple action using Selenium, namely opening google images in Firefox browser. I also use a proxy server running on the localhost. from selenium.webdriver import Firefox, FirefoxOptions from…
Helen
  • 463
  • 2
  • 9
  • 23
0
votes
1 answer

Does content encoding only compress for transmission, or also for persistent storage in S3?

Does 'Content-Encoding': 'gzip' reduce the file size in AWS S3? Documentation says: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding This lets the recipient know how to decode the representation in order to obtain the…
user19473296
0
votes
1 answer

Why Facebook debugger raise: The crawler accepts deflate and gzip content encodings

Got this warning: Image Unavailable Provided og:image, https://t44-post-cover.s3.eu-central-1.amazonaws.com/7ou5 could not be downloaded. This can happen due to several different reasons such as your server using unsupported content-encoding. The…
János
  • 32,867
  • 38
  • 193
  • 353
0
votes
1 answer

Is Gzip compressed binary data or uncompressed text safe to transmit over https, or should it be base 64 encoded as the final step before sending it?

My question is in the title, this provides context to help you understand my confusion. Everything is sent over https. My understanding of base 64 encoding is that it is a way of representing binary data as text, such that the text is safe to…
still_dreaming_1
  • 8,661
  • 6
  • 39
  • 56
0
votes
0 answers

Accept GZip compressed body in AWS Lambda through AWS API Gateway

I have constructed an API with AWS API Gateway that is used to call an AWS Lambda function to do some serverless computing. The payload size that I am passing through is too great (over 10 mb) so I have looked into compressing the payload clientside…
0
votes
0 answers

TIKA - Compute Content-Encoding of a document

I'm using Tika 1.26 in order to extract metadata of a document. I first gave a try to the Tika Server and then I switched to programmatic API. Nevertheless, even if the documentation states that the Content-Encoding of a document should be returned…
verodigiorgio
  • 353
  • 3
  • 13
0
votes
1 answer

Gunzipping Contents of a URL - Python

I'm back. :) Again trying to get the gzipped contents of a URL and gunzip them. This time in Python. The #SERVER section of code is the script I'm using to generate the gzipped data. The data is known good, as it works with Java. The #CLIENT section…
Patrick Perini
  • 22,555
  • 12
  • 59
  • 88
0
votes
1 answer

2 different `Content-Encoding` on 2 different aspnet core webapi `Actions`

I have Controller1/Action1, which currently don't care about Accept-Encoding in request and return application/json response always. Now in same application, we are adding Controller2/Action2, which will return huge json (~5mb) and want to use…
PKV
  • 773
  • 1
  • 7
  • 17
0
votes
1 answer

How to decode ContentEncoding.SevenBit and ContentEncoding.EightBit MimePart with C# MailKit

I have this piece of code: private string DecodeMimePart(MimePart mimePart) { var decodedString = ""; IMimeDecoder mimeDecoder = mimePart.ContentTransferEncoding switch { ContentEncoding.SevenBit => throw new…
Giuseppe Terrasi
  • 479
  • 7
  • 22
0
votes
1 answer

How to get the site content in french language

I have a site whose content is in French language. Now I want to get these through HttpWebRequest and HttpWebResponse in console application using c#. public string GetContents(string url) { StreamReader _Answer; try { …
Aamir
  • 1
  • 1
0
votes
1 answer

Java: HttpResponse headers never have "Content-Encoding" but do have "Vary: Accept-Encoding"

I'm using the following example: http://www.devdaily.com/java/jwarehouse/commons-httpclient-4.0.3/httpclient/src/examples/org/apache/http/examples/client/ClientGZipContentCompression.java.shtml While adding "Accept-Encoding: gzip" to the headers is…
joshholat
  • 3,371
  • 9
  • 39
  • 48