Re: Dealing with bad HTTP headers

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Colin Crossman wrote:

> So, I'm trying to write a web spider for some data gathering from a
> public database webserver. Anyway, in response to a POST, the
> webserver returns "200 Script Results Follow" instead of "201
> CREATED".

A 201 should only be returned if a new resource was created on the
server-side. If that is the case but you get a 200 response instead,
it's a server-side error.

Do note that "200 Script Results Follow" is a perfectly legal HTTP
status line. The HTTP spec defines status codes, but only *recommends*
reason phrases. Accordingly, "Script Results Follow" is as good as "OK"
or "Aye aye, Sir".


> While both IE and Firefox ignore the odd header, this
> response kills my HttpWebRequest with a WebException -
> "System.Net.WebException: The server committed a protocol violation.
> Section=ResponseStatusLine".
>
> Does anyone know of a workaround for this?

What .NET version are you using? I've tested this briefly in both 1.1
and 2.0 Beta 2, and both work with arbitrary reason phrases:

Cheers,
--
http://www.joergjooss.de
mailto:news-reply@xxxxxxxxxxxxx
.



Relevant Pages

  • Re: HTTP in the background in IE
    ... > Thomas 'PointedEars' Lahn wrote: ... > sends back a normal HTTP 200 response containing a nicely formatted HTML ... Are we talking about server-side XMLHTTP ...
    (comp.lang.javascript)
  • Re: Adobes response to the WPF/e threat
    ... I think your response would be greatly helped by going and learning what ... For starters, its a server-side technology... ... WPF/e has nothing todo with serverside technology... ...
    (borland.public.delphi.non-technical)
  • Re: Adobes response to the WPF/e threat
    ... I think your response would be greatly helped by going and learning what ... For starters, its a server-side technology... ... WPF/e has nothing todo with serverside technology... ... development environment more appealing to developers. ...
    (borland.public.delphi.non-technical)
  • Re: conversion from vbscript to javascript
    ... I needed to convert it into Javascript. ... :> In my asp page I had response.write to return the response back. ... even on server-side is case-sensitive. ... without even the implied warranty of merchantability ...
    (microsoft.public.scripting.jscript)
  • Re: What is a class?
    ... Aye aye. ... -1 response not phrased in the form of a question. ... from toimp import * ... exec(open('toimp.py').read) ...
    (comp.lang.python)