Exemplo n.º 1
0
//---------------------------------------------------------------------------
void __fastcall THttpTestForm::HeadButtonClick(TObject *Sender)
{
    int I;

    DisplayMemo->Clear();
    DocumentMemo->Clear();
    SetButtonState(FALSE);

    PrepareConnection();
    SslHttpCli1->RcvdStream = NULL;

    try {
        SslHttpCli1->Head();
    } __except (TRUE) {
        SetButtonState(TRUE);
        Display("HEAD Failed !");
        Display("StatusCode   = " + IntToStr(SslHttpCli1->StatusCode));
        Display("ReasonPhrase = " + SslHttpCli1->ReasonPhrase);
        return;
    }

    Display("StatusCode = " + IntToStr(SslHttpCli1->StatusCode));

    for (I = 0; I < SslHttpCli1->RcvdHeader->Count; I++)
        Display("hdr>" + SslHttpCli1->RcvdHeader->Strings[I]);

    SetButtonState(TRUE);
}
Exemplo n.º 2
0
bool SendMailSms::SendEmail(const char* from, const char* to, const char* subject, const char* body) {
  PrepareConnection(sendEmailPath);
  AddParam("from", from);
  AddParam("sender", from);
  AddParam("replyTo", from);
  AddParam("subject", subject);
  AddParam("to", to);
  AddParam("bodyText", body);
  return FinalizeConnection();
}
Exemplo n.º 3
0
//---------------------------------------------------------------------------
void __fastcall THttpTestForm::GetButtonClick(TObject *Sender)
{
    try {
        PrepareConnection();
        Display("Connecting...");
        GetButton->Enabled = FALSE;
        DocumentMemo->Clear();
        SslHttpCli1->GetASync();
    } catch (Exception& E) {
        Display("Connect error. " + E.ClassName() + ": " + E.Message);
        return;
    }
}
Exemplo n.º 4
0
bool
Client::Connect(const SocketType& type)
{
  fType = type;
  try {
    Start();
    PrepareConnection();
    Announce();
  } catch (Exception& e) { 
    e.Dump();
    return false;
  }

  fIsConnected = true;
  return true;
}