[SOLVED] application.navigate() and POST

Answered
0
0

Howdy,

I want to open a url sending POST values.
How would this be possible using this function?

Thanks,

  • You must to post comments
Best Answer
0
0

Hi Jorge,

that sample is in C# but it´s quite simple so I am sure you will be able to transfer that concept to VB.net.

Basically the idea is to have a default.aspx processing and storing the values in a way that the Wisej
application that is not loaded yet can post process them.

To test it please open HtmlPageTest.html and see how the form posts the data to default.aspx.
default.aspx forwards the data to your final Wisej application.

Here you can process it in Application.Browser.UserData and do all further coding with the data that is required.

Hope that helps.

Best regards
Frank

  • Jorge Bastos
    Hi Frank, Thanks for your effort, hum, it’s kinda complicated for me.. I was hoping to do it like i do it with PHP scripts, just get data from POST, and echo to the output the info i need, in case, i create some XML data. No way to do it easiely here, right?
  • Luca (ITG)
    It’s the same as PHP. In PHP: $name = $_POST[“name”]; in aspx C#: var name = Request[“name”]; Once you read the post variables you can use them in your Wisej app by assigning them to Wisej.userData as an object (see sample) and you will find them on the server side in your app as Application.Browser.UserData.name or Application.Browser.UserData.lastname.
  • You must to post comments
Great Answer
0
0

Jorge,

please take a look at the WebRequest class.
Find some sample e.g. here:

https://stackoverflow.com/questions/6108531/how-to-send-a-post-in-net-vb

Best regards
Frank

  • You must to post comments
0
0

Hi Jorge,

if I understand you correctly you want to process some data sent by Post to your Wisej application ?
If that´s the case I can you provide you with a sample how you can achieve this.

If not, please try to specify what you are trying to achieve.

Thanks in advance.

Best regards
Frank

  • Jorge Bastos
    Hi Frank, Yes, I’ll have another app making POST request’s to my app, and i want to process that requests/data to insert it into the db. If possible then the example, please vb.net on it!
  • You must to post comments
0
0

Hi Frank,

Well, I made some progress (i think).
So in the load of my login form, i can catch the query string values, using this (or other code)

For Each key As String In Application.QueryString.AllKeys
MessageBox.Show(String.Format(“{0}={1}”, key, Application.QueryString(key)))
Next

BUT, if i want to send post values instead of GET (query string) to the app, without using the login form, using a separated form, just for this interconnection.
That is: Going to send values in POST, that i’ll process and display JUST XML to read on the other side.

How would this be “achievable”?

  • You must to post comments
0
0

Hum.

I know this is offtopic, but if it’s possible to give some help.
So I have the code below, but how to make it open on a new browser window/tab?

Dim s As System.Net.HttpWebRequest
Dim enc As System.Text.UTF8Encoding
Dim postdata As String
Dim postdatabytes As Byte()
s = System.Net.HttpWebRequest.Create(“https://host.pt/phpmyadmin/”)
enc = New System.Text.UTF8Encoding()
postdata = “pma_username=root&pma_password=xxxxxxxxx&db=mysql&server=1”
postdatabytes = enc.GetBytes(postdata)
s.Method = “POST”
s.ContentType = “application/x-www-form-urlencoded”
s.ContentLength = postdatabytes.Length

Using stream = s.GetRequestStream()
stream.Write(postdatabytes, 0, postdatabytes.Length)
End Using
Dim result = s.GetResponse()

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.