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>

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"


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
        End Using


        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?


Matt Bates
Received on Tuesday, 16 June 2009 20:51:53 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:01:04 UTC