© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago
Tony Wang

HttpResponseMessage.Content.Header.ContentEncoding is empty

Hello,
I am working with the .net HttlClient and have troubles setting up the response message correctly. I use the httpListener to process the request and send the response.

To create and send the response I use the HttpListenerContext.Response Object. I set the Content Encoding via HttpListenerContext.Response.Encoding, and write the content to the output stream.

I can send requests to my server and they are processes correctly, but the ContentEncoding header is empty in the response message that I receive with my client. I am not sure what I am doing wrong.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

How to assert HttpResponseMessage content in unit test [Answered]
C#CC# / help
4y ago
Request header field content-type is not allowed
C#CC# / help
2y ago
✅ Select Resources is empty
C#CC# / help
2mo ago
❔ response body is empty
C#CC# / help
4y ago