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 7090097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:00:13+00:00 2026-05-28T08:00:13+00:00

I’m making a request to a website via the HttpWebRequest/HttpWebResponse objects. I’m making several

  • 0

I’m making a request to a website via the HttpWebRequest/HttpWebResponse objects.

I’m making several successful calls to the web site and every other call to the same dynamic page is failing.

In the debugger I’m getting a “Internal server error 500” fiddler also shows a 500 response and contains:

[Fiddler] Response Header parsing failed.
This can be caused by an illegal HTTP response earlier on this reused server socket--     for instance, a HTTP/304 response which illegally contains a body.
Response Data:
<plaintext> 
0D 0A 3C 21 44 4F 43 54 59 50 45 20 48 54 4D 4C 20 50 55 42 4C 49 43 20  ..<!DOCTYPE      HTML PUBLIC 
22 2D 2F 2F 57 33 43 2F 2F 44 54 44 20 48 54 4D 4C 20 34 2E 30 20 54 72  "-//W3C//DTD HTML 4.0 Tr
61 6E 73 69 74 69 6F 6E 61 6C 2F 2F 45 4E 22 3E 0D 0A 3C 48 54 4D 4C 3E  ansitional//EN">..<HTML>
0D 0A 09 3C 48 45 41 44 3E 0D 0A 09 09 3C 74 69 74 6C 65 3E 56 69 65 77  ...<HEAD>....<title>View

I’ve removed all the hex and viewed the page and is what I expect to be returned but for some reason the server is reporting a 500 and the HttpWebRequest object throws an exception on this.

I’ve tried all the other “fixes” for this issue and none work. It might just be malformed data sent from the server but is there a lower level object to use than HttpWebRequest that’s not a pita to work with?

EDIT: I didn’t include the entire hex/entire html block in the above example.
EDIT: Turning off fiddler I get this in the debugger

EDIT: So, from what I’ve seen the HttpWebResponse object is acting accordingly. The server is just flaky and sometime returns the same exact data with different http status codes. For a quick fix I just wrapped each call in a try/catch and in the catch block just retying the exact same call. So far it works great and semi-proves that it’s the sites fault and not the HttpWebResponse object.

The server committed a protocol violation. Section=ResponseStatusLine
  • 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-28T08:00:13+00:00Added an answer on May 28, 2026 at 8:00 am

    Hei Jon,

    Is the same outcome without Fiddler? (just printing the exception on screen). I had trouble sometimes with debuggers misbehavior.

    If the server is returning intermittent error and you do not have control over it, I am afraid you can not do much. The message seems clear that is a standard for 304 that the response should not have a body, but the server can do whatever it wants, so it is pretty much its problem to address to.

    See W3C: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

    If the client has performed a conditional GET request and access is
    allowed, but the document has not been modified, the server SHOULD respond with this status code. The 304 response MUST NOT contain a message-body, and thus is always terminated by the first empty line after the header fields.

    Regarding the HttpWebRequest, I never had any problems, and never heard of any cases it can not handle HTTP communication. But if the case is that you want to go nuts and handle the packets yourself, Google how to build your own HttpWebRequest with sockets.

    This project could be a start:
    http://www.codeproject.com/Articles/13486/A-Simple-Crawler-Using-C-Sockets

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I used javascript for loading a picture on my website depending on which small
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm making a simple page using Google Maps API 3. My first. One marker
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

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.