West Wind Internet Protocols 4.68 |
wwHTTP::AddPostkey
|
POST data is the main mechanism that HTTP uses to send data from the client to the server. POST data typically gets encoded on the client and then sent up to the server. Several different mechanisms are available:
Web Connection supports all three conntent types through the nHTTPPostMode property setting. If you wish to post a raw or binary buffer you can simply pass a single parameter to AddPostKey with the value and it gets written as is.
HTTP File Uploads are supported via the tlFileName parameter which specifies a file to upload to the server. Make sure you use nHTTPPostMode=2 to specify multipart forms be created in the POST buffer.
Syntax: |
o.AddPostKey(tcKey, tcValue, tlIsFile) |
| Return: | nothing |
| Parameters: |
tcKey The key value to set. One special value can also be used: RESET - clears any existing POST data. No value is required to be passed in this case. If you call AddPostKey with no paramters at all the POST buffer is also cleared. BLANK - ("" or omitted) if this value is empty or not provided tcValue will be used to write the entire POST buffer unencoded. Use for XML documents or anything where you need to post a raw POST buffer. tcValue tlIsFile |
| Example: |
|
| Remarks: | UrlEncoded content that is longer than 254 characters requires wwIPStuff.dll for the URLEncoding using C++ code for better performance. This refers to the default nHttpPostMode value of 1. Depending on the value of the nHTTPPostMode property forms are posted either in standard URLEncoded or Multi-Part form mode. Multi-part form mode can be more efficient for large uploads as no encoding takes place, but the server application must support parsing multi-part forms. Web Connection automatically handles this via Request.Form().
|
See also: