Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6528267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:31:07+00:00 2026-05-25T09:31:07+00:00

I have converted my custom (socket-based) server over to an HTTP Handler in IIS

  • 0

I have converted my custom (socket-based) server over to an HTTP Handler in IIS (.NET 4.0).

I have converted my client to send an HTTP GET in the proper format.

I do not want to change my client’s response-handling code to parse out the HTML code. That is a pain in the rear that is also unnecessary. I do not need this server to work with a browser or be compatible with anything except my client.

So, I basically need the HTTP Handler (server) to send the response that the client expects — without the “HTML/1.0”, headers and whatnot.

I am using the HttpContext.Response.Write() method at the moment. I figure there is either a way to write raw data to the response, or a way to delete all the headers and HTML tags around the data I want to send.

Thanks in advance for any help.
Dave

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T09:31:08+00:00Added an answer on May 25, 2026 at 9:31 am

    If you are looking at this in a browser to verify, then what you may be seeing is the browsers attempt to fix your HTML for you.

    For instance if I have this in my Handler:

    public void ProcessRequest(HttpContext context)
    {
        context.Response.Write("Hello World");
    }
    

    Then the Response Headers will look like this:

    HTTP/1.1 200 OK
    Server: ASP.NET Development Server/10.0.0.0
    Date: Sat, 03 Sep 2011 03:26:36 GMT
    X-AspNet-Version: 4.0.30319
    Cache-Control: private
    Content-Type: text/html; charset=utf-8
    Content-Length: 11
    Connection: Close

    The actual content of the response is simply

    Hello World

    You’ll notice the default content type is text/html, however, you basically have full control over the response. You can clear the headers, add new ones, and set the content type accordingly:

    public void ProcessRequest(HttpContext context)
    {
        context.Response.ClearHeaders();
        context.Response.AddHeader("my-skillz", "being AWESOME!");
        context.Response.ContentType = "text/plain";
        context.Response.Write("Hello World");
    }
    

    Which will yield the following Response Headers:

    HTTP/1.1 200 OK
    Server: ASP.NET Development Server/10.0.0.0
    Date: Sat, 03 Sep 2011 03:40:14 GMT
    X-AspNet-Version: 4.0.30319
    my-skillz: being AWESOME!
    Cache-Control: private
    Content-Type: text/plain; charset=utf-8
    Content-Length: 11
    Connection: Close

    So there you have it. Take a look at the docs on HttpResponse so you can see all that is available to you, and you should be able to get exactly what you want out of the responses without any extra headache, and no HTML anywhere in sight.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wish to develop a client-server application in .NET that functions as follows: Clients
I had a custom MXML component, that I have converted to a pure AS3
So here is what we have, a custom IEEE based setup: Consider a five-bit
I'd like to have a custom usercontrol based on textbox where I could type
I have a function within a custom CRM web application (old VB.Net circa 2003)
I have been out of VB.Net way too long, I have a custom class
I have a simple custom view that is connected via outlet to a NIB.
I have an array of custom objects. MyCustomArr[]. I want to convert this to
I have converted an array to object data like this: <?php $myobject->data = (object)Array('zero','one','two');
I have converted an Entity framework project to use POCO objects by removing the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.