WebTcpipSend Function

Action

Sends a string to the remote host. Before WebTcpipSend can be used, a valid connection has to be established with WebTcpipConnect.

Include file

WebAPI.bdh

Syntax

WebTcpipSend( in hWeb          : number,
              in sStringToSend : string ): boolean;

Return value

  • true if the string is sent successfully

  • false otherwise

Parameter Description
hWeb Valid handle to a Web connection that was created by WebTcpipConnect
sStringToSend String to send to the remote host

Example

dcltrans
  transaction TWebApplevel
  var
    hWeb : number;
    nRecv : number;
  begin
    // Get the root HTML page of the Web server defined
    // by standardhost with a custom client header
    WebTcpipConnect(hWeb, "standardhost", WEB_PORT_HTTP);
    WebTcpipSend(hWeb, "GET / HTTP/1.0\r\n"
                     "User-Agent: CustomClient/1.0\r\n"
                     "Accept: */*\r\n\r\n");
    WebTcpipRecvClose(hWeb, 0, 0, nRecv);
    WebTcpipShutdown(hWeb);
  end TWebApplevel;

Sample scripts

WebFileUpload01.bdf, WebMulti01.bdf, WebSecure01.bdf, WebTcpipHttp01.bdf, WebTcpipWebStone01.bdf