LInetHttp::SendRequest

#include "ltwrappr.h"

L_INT LInetHttp::SendRequest(pszHeader, ulHeaderSize, pszOptional, ulOptionalSize)

L_TCHAR L_FAR *pszHeader;

/* pointer to header data */

L_UINT32 ulHeaderSize;

/* sizeof the header data */

L_TCHAR L_FAR *pszOptional;

/* optional data */

L_UINT32 ulOptionalSize;

/* sizeof the optional data */

Sends an HTTP request to the HTTP server.

Parameter

Description

pszHeader

Pointer to any additional header data to be sent along with the request. This parameter can be NULL if there are no additional headers to append.

ulHeaderSize

Size of the data in pszHeader.

pszOptional

Pointer to any optional data to be sent after the HTTP header. This parameter is generally used for POST and PUT operations. The optional data can be the resource or information being posted to the server. This parameter can be NULL if there is no optional data to send.

ulOptionalSize

Size of the data in pszOptional.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTWEB

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions:

LInetHttp::OpenRequest, LInetHttp::SendBitmap, LInetHttp::SendData, LInetHttp::SendForm, Class Members

Topics:

HTTP Functions: Sending / Getting Data

 

How to Program with the LInetHttp Class

Example

// This sample sends a request to the HTTP web server

L_VOID TestSendRequest(HWND hWndParent)
{
   LInetHttp   InetHttp(TEXT("www.leadtools.com"));

   // Checking if the connection failed
   if(InetHttp.GetErrorFromList () != SUCCESS)
   {
      InetHttp.DisplayError (hWndParent, TEXT("Can't connect to the HTTP web server"));
      return;
   }

   if(InetHttp.OpenRequest (HTTP_POST, TEXT("/default.htm")) != SUCCESS)
   {
      InetHttp.DisplayError(hWndParent, TEXT("Can't open a request"));
      return;
   }

   if(InetHttp.SendRequest(NULL, 0, NULL, 0) != SUCCESS)
   {
      InetHttp.DisplayError (hWndParent, TEXT("Can't send a request, an error may occurred"));
      return;
   }
}