dotnet / dotnet/dotnet-api-docs

Sample works without setting ContentEncoding

Open
#1,807 0 comments 0 reactions 0 assignees View on GitHub
area-System.Net dotnet-api/prod Pri2 untriaged
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

Since the sample writes binary data, it's not clear why we need to set the `ContentEncoding` property. Does that cause an HTTP header to be automatically added? If not, who is using the value of `ContentEncoding`, and why does it work when I do not change the property?

---
#### Document Details

⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*

* ID: 7325d31c-5cde-9a56-0a16-04f6e12020a2
* Version Independent ID: 4e4e5ad2-e362-14c6-f97d-4bbe7b75d76d
* Content: [HttpListenerResponse.ContentEncoding Property (System.Net)](https://docs.microsoft.com/en-us/dotnet/api/system.net.httplistenerresponse.contentencoding?view=netframework-4.7.2)
* Content Source: [xml/System.Net/HttpListenerResponse.xml](https://github.com/dotnet/dotnet-api-docs/blob/master/xml/System.Net/HttpListenerResponse.xml)
* Product: **dotnet-api**
* GitHub Login: @karelz
* Microsoft Alias: **ncldev**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.