Non-standard HTTP Post

Using Servoy to administrate the content of your website? Discuss all webrelated Servoy topics on this forum!

Non-standard HTTP Post

Postby martinh » Wed Nov 04, 2009 6:05 pm

Hi,

I need to use a HTTP Post like described below:

Code: Select all
// 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
Martin
------------------------------------------------
Servoy Developer
Version 5.2.10/5.2.13
Java version 1.6 update 31
Database SQL Server 2008 R2
martinh
 
Posts: 857
Joined: Wed May 09, 2007 5:34 pm
Location: Belgium

Re: Non-standard HTTP Post

Postby gabid » Fri Aug 06, 2010 12:11 pm

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
User avatar
gabid
 
Posts: 44
Joined: Fri Aug 15, 2008 10:25 am
Location: Craiova, Romania

Re: Non-standard HTTP Post

Postby martinh » Fri Aug 06, 2010 12:13 pm

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.
Martin
------------------------------------------------
Servoy Developer
Version 5.2.10/5.2.13
Java version 1.6 update 31
Database SQL Server 2008 R2
martinh
 
Posts: 857
Joined: Wed May 09, 2007 5:34 pm
Location: Belgium

Re: Non-standard HTTP Post

Postby lvostinar » Fri Aug 06, 2010 2:16 pm

martinh wrote: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.
Laurian Vostinar
Servoy
lvostinar
 
Posts: 1062
Joined: Tue Feb 19, 2008 10:53 am


Return to Web Development

Who is online

Users browsing this forum: No registered users and 4 guests