XBinder  Version 2.7.x
Functions
rtxHttp.h File Reference
#include "rtxsrc/rtxArrayList.h"
#include "rtxsrc/rtxNetUtil.h"

Go to the source code of this file.

Functions

EXTERNRT int rtxHttpConnect (OSRTNETCONN *pNetConn)
 This function executes a full synchronous HTTP CONNECT request to setup a connection through a proxy. More...
 
EXTERNRT int rtxHttpGet (OSCTXT *pctxt, const char *url, OSRTHttpContent *pContent)
 This function executes a full synchronous HTTP GET request. More...
 
EXTERNRT int rtxHttpSendGetRequest (OSRTNETCONN *pNetConn, const char *url)
 This function sends an HTTP GET request to a network connection. More...
 
EXTERNRT int rtxHttpSendRequest (OSRTNETCONN *pNetConn, const char *method, const char *content, const char *contentType)
 This function sends an HTTP request to a network connection. More...
 
EXTERNRT int rtxHttpRecvRespHdr (OSRTNETCONN *pNetConn, OSRTHttpHeader *pHeader)
 This function receives the initial header returned from an HTTP request. More...
 
EXTERNRT int rtxHttpRecvContent (OSRTNETCONN *pNetConn, OSRTHttpHeader *pHeader, OSRTHttpContent *pContent)
 This function receives HTTP content. More...
 
EXTERNRT int rtxHttpRecvRespContent (OSRTNETCONN *pNetConn, OSRTHttpHeader *pHeader, OSRTHttpContent *pContent)
 This function receives any HTTP content indicated by the response header. More...
 

Function Documentation

◆ rtxHttpConnect()

EXTERNRT int rtxHttpConnect ( OSRTNETCONN *  pNetConn)

This function executes a full synchronous HTTP CONNECT request to setup a connection through a proxy.

Parameters
pNetConn- Pointer to network connection structure.
Returns
- Operation status: 0 if success, negative code if error.

◆ rtxHttpGet()

EXTERNRT int rtxHttpGet ( OSCTXT pctxt,
const char *  url,
OSRTHttpContent *  pContent 
)

This function executes a full synchronous HTTP GET request.

A network connection is opened and a GET request sent to the given URL. The response is then read and returned, after which the network connection is closed.

Parameters
pctxt- Pointer to context structure.
url- Full URL of get request.
pContent- Pointer to content buffer to receive response.
Returns
- Operation status: 0 if success, negative code if error.

◆ rtxHttpRecvContent()

EXTERNRT int rtxHttpRecvContent ( OSRTNETCONN *  pNetConn,
OSRTHttpHeader *  pHeader,
OSRTHttpContent *  pContent 
)

This function receives HTTP content.

All content associated with the response header is stored in the given memory buffer.

Parameters
pNetConn- Pointer to network connection structure.
pHeader- Pointer to response header structure describing content.
pContent- Buffer to receive content. Dynamic memory is allocated for the content using the rtxMemAlloc function.
Returns
- Operation status: 0 if success, negative code if error.

◆ rtxHttpRecvRespContent()

EXTERNRT int rtxHttpRecvRespContent ( OSRTNETCONN *  pNetConn,
OSRTHttpHeader *  pHeader,
OSRTHttpContent *  pContent 
)

This function receives any HTTP content indicated by the response header.

If the header does not indicate any additional content, the function does nothing.

Parameters
pNetConn- Pointer to network connection structure.
pHeader- Pointer to response header structure describing content.
pContent- Buffer to receive content. Dynamic memory is allocated for the content using the rtxMemAlloc function.
Returns
- Operation status: 0 if success, negative code if error.

◆ rtxHttpRecvRespHdr()

EXTERNRT int rtxHttpRecvRespHdr ( OSRTNETCONN *  pNetConn,
OSRTHttpHeader *  pHeader 
)

This function receives the initial header returned from an HTTP request.

The header response information is returned in the header structure.

Parameters
pNetConn- Pointer to network connection structure.
pHeader- Pointer to header structure to receive returned data.
Returns
- Operation status: 0 if success, negative code if error.

◆ rtxHttpSendGetRequest()

EXTERNRT int rtxHttpSendGetRequest ( OSRTNETCONN *  pNetConn,
const char *  url 
)

This function sends an HTTP GET request to a network connection.

Parameters
pNetConn- Pointer to network connection structure.
url- Full URL of get request. May be set to NULL if URL was provided earlier in rtxNetInitConn function call.
Returns
- Operation status: 0 if success, negative code if error.

◆ rtxHttpSendRequest()

EXTERNRT int rtxHttpSendRequest ( OSRTNETCONN *  pNetConn,
const char *  method,
const char *  content,
const char *  contentType 
)

This function sends an HTTP request to a network connection.

Parameters
pNetConn- Pointer to network connection structure.
method- HTTP method to be used for request (GET or POST)
content- Content to be sent after header.
contentType- Type of content.
Returns
- Operation status: 0 if success, negative code if error.