tfHttpdUserSendResponseHeaders

Jump to: navigation, search

Table of Contents >> Application Reference >> Web Server


#include <trsocket.h>


int tfHttpdUserSendResponseHeaders (
ttHttpdUserConHandle userConHandle,
ttUserIntPtr headerCountPtr,
ttHttpUserHeaderTypePtr headerTypes,
ttUserConstCharPtrPtr headerValues,
int flags
);


Function Description

Low-level API for sending a customer defined HTTP response that overrides the default HTTP response: Send the HTTP response headers through the connection.


Parameters

  • userConHandle
    User connection handle.
  • headerCountPtr
    Points to Number of HTTP headers in the headerNames and headerValues array. The input value indicates the number of headers to be sent, when this API returns, the output value is updated to be the number of headers sent out.
  • headerTypes
    Array of HTTP header types, each element is one of the following value:
    TM_HTTP_HEADER_ALLOW
    TM_HTTP_HEADER_AUTHORIZATION
    TM_HTTP_HEADER_CONNECTION
    TM_HTTP_HEADER_CONTENT_ENCODING
    TM_HTTP_HEADER_CONTENT_LENGTH
    TM_HTTP_HEADER_CONTENT_TYPE
    TM_HTTP_HEADER_DATE
    TM_HTTP_HEADER_EXPIRES
    TM_HTTP_HEADER_FROM
    TM_HTTP_HEADER_IF_MODIFIED_SINCE
    TM_HTTP_HEADER_LAST_MODIFIED
    TM_HTTP_HEADER_LOCATION
    TM_HTTP_HEADER_PRAGMA
    TM_HTTP_HEADER_RANGE
    TM_HTTP_HEADER_REFERER
    TM_HTTP_HEADER_SERVER
    TM_HTTP_HEADER_TRANSFER_ENCODING
    TM_HTTP_HEADER_USER_AGENT
    TM_HTTP_HEADER_WWW_AUTHENTICATE
    TM_HTTP_HEADER_RETRY_AFTER
    TM_HTTP_HEADER_IF_NONE_MATCH
    TM_HTTP_HEADER_ETAG
    TM_HTTP_HEADER_IF_MATCH
    TM_HTTP_HEADER_X_FRAME_OPTIONS
    TM_HTTP_HEADER_X_XSS_PROTECTION
    TM_HTTP_HEADER_X_CONTENT_TYPE_OPTIONS
    TM_HTTP_HEADER_STRICT_TRANSPORT_SECURITY
    If TM_USE_SOAP is enabled, the following header type is also supported:
    TM_HTTP_HEADER_SOAPACTION
    TM_HTTP_HEADER_EXT
    If TM_USE_GENA is enabled, the following header type is also supported:
    TM_HTTP_HEADER_SID
    TM_HTTP_HEADER_TIMEOUT
    TM_HTTP_HEADER_HOST
    TM_HTTP_HEADER_NT
    TM_HTTP_HEADER_NTS
    TM_HTTP_HEADER_SEQ
    TM_HTTP_HEADER_CALLBACK
  • headerValues
    Array of HTTP header values as null terminated string.
  • flags
    Bit mask: currently the supported flag is only: TM_HTTPD_END indicating the end of the response message. I.e. the response consists of the status line and headers only. No body will follow.


Returns

  • TM_ENOERROR
    Success
  • TM_EINVAL
    Invalid userConHandle.
  • TM_EPERM
    The status line has not been sent out yet.
  • TM_EWOULDBLOCK
    Indicates that the send queue is full, the response could not be sent out now, the user should try again.


Table of Contents >> Application Reference >> Web Server