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

BOOL PHTTPClient::GetDocument ( const PURL url,
PMIMEInfo &  outMIME,
PMIMEInfo &  replyMIME,
BOOL  persist = TRUE 

Get the document specified by the URL.

TRUE if document is being transferred.
urlUniversal Resource Locator for document.
outMIMEMIME info in request
replyMIMEMIME info in response
persistif TRUE, enable HTTP persistence

Definition at line 519 of file httpclnt.cxx.

References PURL::AsString(), ExecuteCommand(), PString::IsEmpty(), PHTTP::MovedPermanently, PHTTP::MovedTemporarily, ReadContentBody(), and PHTTP::RequestOK.

Referenced by GetTextDocument().

  int count = 0;
  static const char locationTag[] = "Location";
  PURL url = _url;
  for (;;) {
    PMIMEInfo outMIME = _outMIME;
    PString u = url.AsString();
    int code = ExecuteCommand(GET, url, outMIME, PString(), replyMIME, persist);
    switch (code) {
      case RequestOK:
        return TRUE;
      case MovedPermanently:
      case MovedTemporarily:
          if (count > 10)
            return FALSE;
          PString str = replyMIME(locationTag);
          if (str.IsEmpty())
            return FALSE;
          PString doc;
          if (!ReadContentBody(replyMIME, doc))
            return FALSE;
          url = str;
        return FALSE;

Here is the call graph for this function:

Here is the caller graph for this function:

Generated by  Doxygen 1.6.0   Back to index