I am trying to make an arduino webserver, and this part is done. Now I need to use some compression.
Here is my simple.htm webpage I want to serve
<!DOCTYPE html>
<html>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
I tried to gzip this ( tried different tools, commandline gzip, keka, both slightly different), and got the simple.htm.gz. I opened it in a text editor and it looked like this
ã˝…Vsimple.htm-å;Ä D{OÅêÿoh¸ƒ∆hacπ?§·ˆ.ƒÍeÊe vjñuÓÑ
ש
¯±=:™Çc≠∆(zÁfl ܵª
H.YQ2G6ÑçG≤HJNÊ=3fl}?ı=me
In the server, I did this
char *htmlContent="ã˝…Vsimple.htm-å;Ä D{OÅêÿoh¸ƒ∆hacπ?§·ˆ.ƒÍeÊe vjñuÓÑ◊©¯±=:™Çc≠∆(zÁfl ܵªH.YQ2G6ÑçG≤HJNÊ=3fl}?ı=me"
I served header and content, including "Content-Encoding: gzip
"; But chrome says
This webpage is not available
ERR_CONTENT_DECODING_FAILED
I know my webserver works without gzip and I have tested it and I can see it on the browser. What am I doing wrong here with gzip?