tfHttpdUserGetRequestBody

Jump to: navigation, search

Table of Contents >> Application Reference >> Web Server


#include <trsocket.h>


int tfHttpdUserGetRequestBody (
ttHttpdUserConHandle userConHandle,
ttUserCharPtr bufferPtr,
int bufferLenPtr
);


Function Description

Get a buffer from the received HTTP request message body. This API works in non-blocking mode only, should be and must be called in the event handler when and only when TM_HTTPD_EVENT_BODY_RECV is received. In order for the request to be properly processed, this API needs to be called to consume the request body even if user is not interested in the request body. Flag TM_HTTPD_FLAG_DISCARD could be set if the user is not interested in getting the body buffer and simply wishes to tell the web server to go ahead and discard the body buffers in the current response.


Parameters

  • userConHandle
    User connection handle
  • bufferPtr
    Pointer to the user buffer
  • bufferLenPtr
    Pointer to length of the user buffer, output value is the actual bytes of the body received
  • flags
    Bit mask: currently the only supported flag is TM_HTTPD_FLAG_DISCARD. Use this flag to tell the web server that the user is not interested in the body. The web server will not notify the user with TM_HTTPD_EVENT_BODY_RECV for the current response body any more.


Returns

  • TM_ENOERROR
    Successful
  • TM_EINVAL
    Invalid parameter(s)


Table of Contents >> Application Reference >> Web Server