Non-standard HTTP Post

Hi,

I need to use a HTTP Post like described below:

// Attention: This is not Javascript / Servoy script. This is probably VB .Net

Dim request As HttpWebRequest = CType(WebRequest.Create("https://start.exactonline.nl/docs/XMLDivisions.aspx"), HttpWebRequest)
Dim bFormData As Byte() = Encoding.UTF8.GetBytes("_UserName_=xxx&_Password_=yyy")

request.ContentType = "application/x-www-form-urlencoded"
request.Method = "POST"
request.AllowWriteStreamBuffering = True

Dim reqStream As Stream = request.GetRequestStream()
reqStream.Write(bFormData, 0, bFormData.Length)
reqStream.Close()

Dim response As HttpWebResponse = CType(request.GetResponse(), HttpWebResponse)

If response.StatusCode = HttpStatusCode.OK AndAlso _
StrComp(response.ResponseUri.AbsoluteUri, "https://start.exactonline.nl/docs/XMLDivisions.aspx", CompareMethod.Text) = 0 Then
   'Login succeeded
Else
  'Access denied
End If

The standard Servoy HTTP-Plugin can not handle this, because one of reasons is the request.ContentType = “application/x-www-form-urlencoded”
This has been confirmed by Servoy Support.

Is there anyone who faced the same problem and found a solution to implement a post like this?

Martin

Hello Martin,

have you solved this issue?

I have to do the same and I would preffer to not reinvent the wheel. :D

Thanks!
Gabriel - Iulian Dumbrava

No this problem has never been solved.
We will try this later with Servoy 5.1 or even 5.2, but at the moment we don’t have resources to do this.

martinh:
No this problem has never been solved.
We will try this later with Servoy 5.1 or even 5.2, but at the moment we don’t have resources to do this.

In Servoy 5 we have poster.addHeader so content type can be specified. So, this should work now.