Re: Dealing with bad HTTP headers
- From: "Joerg Jooss" <news-reply@xxxxxxxxxxxxx>
- Date: Sat, 28 May 2005 02:49:43 -0700
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
.
- References:
- Dealing with bad HTTP headers
- From: Colin Crossman
- Dealing with bad HTTP headers
- Prev by Date: C# Web Services problem
- Next by Date: Asynchronous sockets and pooled thread loading
- Previous by thread: Re: Dealing with bad HTTP headers
- Next by thread: KeyDown without focus?
- Index(es):
Relevant Pages
|