I need to Post some long data to our webserver and I need the server to parse the data as Post variables. Using the HTTP library, I can send GET data easily by appending the variables to the URL (ex. url.php?var1=Y&var2=N).
Since I have some long data that really can't get sent via the GET method, how can I easily send data using the POST method? I have seen the way the tutorial uses the PUT method and reading from a file, but I am not uploading a file. I just need to send data pairs to the server as POST variables.
In a normal HTML page, the form would look like this:
<form>
<input type="hidden" name="var1" value="Y">
<input type="hidden" name="var2" value="N">
<input type="submit" value="submit">
</form>
How can I accomplish the same thing with PPC?
Here is what I have now, but it doesn't work:
**********************
Request.New1("http://www.url.com") 'Build the request.
Request.Method = "POST"
Request.TimeOut = 30000 '30 seconds
Response.New1
Writer.New1(Request.GetStream,true)
Writer.WriteString("<input type='hidden' name='tet' value='im alive'>")
Response.Value = Request.GetResponse 'Call the server
result = Response.GetString 'Get the string from the response stream.
Response.Close
************************
Thanks for all the help. You guys are great!
Since I have some long data that really can't get sent via the GET method, how can I easily send data using the POST method? I have seen the way the tutorial uses the PUT method and reading from a file, but I am not uploading a file. I just need to send data pairs to the server as POST variables.
In a normal HTML page, the form would look like this:
<form>
<input type="hidden" name="var1" value="Y">
<input type="hidden" name="var2" value="N">
<input type="submit" value="submit">
</form>
How can I accomplish the same thing with PPC?
Here is what I have now, but it doesn't work:
**********************
Request.New1("http://www.url.com") 'Build the request.
Request.Method = "POST"
Request.TimeOut = 30000 '30 seconds
Response.New1
Writer.New1(Request.GetStream,true)
Writer.WriteString("<input type='hidden' name='tet' value='im alive'>")
Response.Value = Request.GetResponse 'Call the server
result = Response.GetString 'Get the string from the response stream.
Response.Close
************************
Thanks for all the help. You guys are great!