Back to product page

FormPost property


Reference to form post fields.

Type

A HttpRequestFormPost object. Reference to HttpRequestFormPort object that implements methods for posting data

Syntax

  • Basic
object.FormPost
The FormPost(object) syntax has these parts:
objectAn expression evaluating to an object of type HttpRequest.

Remarks

FormPost property returns reference to wodHttpDLX's object that will help you post form-alike data to the server using. It will deal with these variables just like with headers - you will reference variable names and variable values, while wodHttpDLX will figure out the rest. When you issue Post method, data will be transferred to the server in request's Body.

When used, wodHttpDLX will add appropriate headers, and make appropriate structure that will be recognized and accepted by the server.

You can also use FormPost for yourself to ease programming of some queries. Since structure of this request is same as regular passing of variables through the URL, you can also request pages using Get method with a little trick. For example, Google expects to receive search query in variable 'q', so typically if you would search for 'weonlydo' keyword, you would have to issue this request in IE: well, this was easy. But, what if there's more than variable 'q' to be specified, possibly containing spaces and unsafe characters? Don't worry - wodHttpDLX can help here also. Use it like this:

     
    ' set up google url
    wodHttp1.URL = "http://www.google.com/search"
    ' define search query
    wodHttp1.Request.FormPost.Add "q", "weonlydo"
    ' move data from forms to url
    wodHttp1.URL = wodHttp1.URL & "?" & wodHttp1.Request.FormPost.ToString
    ' remove data from forms
    wodHttp1.Request.FormPost.RemoveAll
    ' remove content-type header
    wodHttp1.Request.Headers.Remove "Content-type"
    ' get the page!
    wodHttp1.Get
     


Platforms

Windows