W3C home > Mailing lists > Public > www-validator-css@w3.org > June 2009

POST request returns 405 error

From: Matt Bates <Matt.Bates@innovasys.com>
Date: Tue, 16 Jun 2009 17:16:37 +0100
To: "www-validator-css@w3.org" <www-validator-css@w3.org>
Message-ID: <926AD896E898BC4AB0DB7D4A61908DD49D481F2E93@innovasyssrv03.innovasys-local.co.uk>
Hello,

I'm working in .Net and am trying to submit a POST httpwebrequest to the validator using the following:

Dim Url As String = "http://jigsaw.w3.org/css-validator/"
Dim Post As String = "validator?text=" & HttpUtility.UrlEncodeCSSText) & "&warning=0&profile=css2&output=soap12"

And

Private Function GetValidationResponse(ByVal Url As String, ByVal Post As String) As Stream
        Dim Writer As StreamWriter = Nothing
        Dim Request As HttpWebRequest = DirectCast(WebRequest.Create(Url), HttpWebRequest)

        Request.Method = "POST"
        Request.ContentLength = Post.Length
        Request.ContentType = "application/x-www-form-urlencoded"
        Request.Timeout = 2000

        Writer = New StreamWriter(Request.GetRequestStream())

        Using Writer
            Writer.Write(Post)
        End Using

        Writer.Close()

        Return Request.GetResponse.GetResponseStream()
    End Function

At the point of GetResponse the server returns a 405 method not allowed error, am I doing something wrong? Or does the validator not accept POST requests in this way?

Thanks.

Matt Bates
Innovasys
http://www.innovasys.com/
Received on Tuesday, 16 June 2009 20:51:53 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 27 June 2012 00:14:24 GMT