HttpSendDataSprintf

Transmits formatted data to the body of a request.

Syntax

    #include <httpexp.h>
    #include <httpclnt.h> 
     
    int HttpSendDataSprintf (
       HINTERNET   hrequest,
       void       *controlString,
       ...);
    

Parameters

hrequest
(IN) Specifies the client connection handle or the HTTP stack handle.
controlString
(IN) Points to the address of the control string to be formatted into the HTTP data section.
...
(IN) Points to an argument for a conversion specifier. The number of arguments is determined by the format string.

Return Values

If successful, returns 0. Otherwise, returns a nonzero error code.

Decimal

Name

Description

162

ERR_IO_LOCKED

The application must complete the header before data functions are used.

168

ERR_ACCESS_DENIED

The handle is invalid, the call was made out of sequence, or the call was made when a callback on the handle is pending.

255

ERR_BAD_PARAMETER

A parameter is invalid.

>10000

WSA...

WinSock errors.

Remarks

You use the HttpSendDataSprintf function just as you would a printf function, which has a control string and additional arguments as required by the control string. The size of the output string should be limited to less than 1024 characters per call, to prevent internal buffer overflows. This function can be called multiple times to send all the data.

The function can be used to send either client request data or server response data.