Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

BOOL PHTTPClient::PostData ( const PURL url,
PMIMEInfo &  outMIME,
const PString data,
PMIMEInfo &  replyMIME,
BOOL  persist = TRUE 
)

Post the data specified to the URL.

Returns:
TRUE if document is being transferred.
Parameters:
url  Universal Resource Locator for document.
outMIME  MIME info in request
data  Information posted to the HTTP server.
replyMIME  MIME info in response
persist  if TRUE, enable HTTP persistence

Definition at line 566 of file httpclnt.cxx.

References ExecuteCommand(), and PHTTP::RequestOK.

Referenced by PostData().

{
  PString dataBody = data;
  if (!outMIME.Contains(ContentTypeTag)) {
    outMIME.SetAt(ContentTypeTag, "application/x-www-form-urlencoded");
    dataBody += "\r\n"; // Add CRLF for compatibility with some CGI servers.
  }

  return ExecuteCommand(POST, url, outMIME, data, replyMIME, persist) == RequestOK;
}


Generated by  Doxygen 1.6.0   Back to index