XBinder  Version 2.9.x
rtxHttp.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2003-2022 Objective Systems, Inc.
3  *
4  * This software is furnished under a license and may be used and copied
5  * only in accordance with the terms of such license and with the
6  * inclusion of the above copyright notice. This software or any other
7  * copies thereof may not be provided or otherwise made available to any
8  * other person. No title to and ownership of the software is hereby
9  * transferred.
10  *
11  * The information in this software is subject to change without notice
12  * and should not be construed as a commitment by Objective Systems, Inc.
13  *
14  * PROPRIETARY NOTICE
15  *
16  * This software is an unpublished work subject to a confidentiality agreement
17  * and is protected by copyright and trade secret law. Unauthorized copying,
18  * redistribution or other use of this work is prohibited.
19  *
20  * The above notice of copyright on this source code product does not indicate
21  * any actual or intended publication of such source code.
22  *
23  *****************************************************************************/
27 #ifndef _RTXHTTP_H_
28 #define _RTXHTTP_H_
29 
30 #ifndef _OS_NOSOCKET
31 
32 #include "rtxsrc/rtxArrayList.h"
33 #include "rtxsrc/rtxNetUtil.h"
34 
35 typedef struct OSRTHttpHeader {
36  OSUINT8 majorVersion;
37  OSUINT8 minorVersion;
38  OSINT32 status;
39  OSRTArrayList fields;
40 } OSRTHttpHeader;
41 
42 typedef struct OSRTHttpContent {
43  size_t length;
44  OSOCTET* data;
45 } OSRTHttpContent;
46 
47 typedef int tlsInit_t(OSCTXT* pctxt, const char* serverName);
48 typedef int tlsClose_t(OSCTXT* pctxt);
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
61 EXTERNRT int rtxHttpSendConnectRequest (OSRTNETCONN* pNetConn);
62 
77 EXTERNRT int rtxHttpGetTls
78 (OSCTXT* pctxt, const char* url, OSRTHttpContent* pContent,
79  tlsInit_t* f_tls_init, tlsClose_t* f_tls_close);
80 
81 
93 EXTERNRT int rtxHttpGet
94 (OSCTXT* pctxt, const char* url, OSRTHttpContent* pContent);
95 
104 EXTERNRT int rtxHttpSendGetRequest (OSRTNETCONN* pNetConn, const char* url);
105 
115 EXTERNRT int rtxHttpSendRequest (OSRTNETCONN* pNetConn,
116  const char* method, const char* content, const char* contentType);
117 
127 EXTERNRT int rtxHttpRecvRespHdr
128 (OSRTNETCONN* pNetConn, OSRTHttpHeader* pHeader);
129 
140 EXTERNRT int rtxHttpRecvContent
141 (OSRTNETCONN* pNetConn, OSRTHttpHeader* pHeader, OSRTHttpContent* pContent);
142 
154 EXTERNRT int rtxHttpRecvRespContent
155 (OSRTNETCONN* pNetConn, OSRTHttpHeader* pHeader, OSRTHttpContent* pContent);
156 
157 #if defined(_TRACE) || defined(RTXHTTPDBG)
158 
165 void rtxDiagPrintHttpHeader (OSCTXT* pctxt, const OSRTHttpHeader* pHeader);
166 #endif
167 
168 #ifdef __cplusplus
169 }
170 #endif
171 
172 #endif /* _OS_NOSOCKET */
173 
174 #endif
EXTERNRT int rtxHttpSendRequest(OSRTNETCONN *pNetConn, const char *method, const char *content, const char *contentType)
This function sends an HTTP request to a network connection.
ArrayList functions.
EXTERNRT int rtxHttpSendGetRequest(OSRTNETCONN *pNetConn, const char *url)
This function sends an HTTP GET request to a network connection.
EXTERNRT int rtxHttpGetTls(OSCTXT *pctxt, const char *url, OSRTHttpContent *pContent, tlsInit_t *f_tls_init, tlsClose_t *f_tls_close)
TLS-enabled version of rtxHttpGet.
EXTERNRT int rtxHttpSendConnectRequest(OSRTNETCONN *pNetConn)
This function executes a full synchronous HTTP CONNECT request to setup a connection through a proxy...
EXTERNRT int rtxHttpRecvRespContent(OSRTNETCONN *pNetConn, OSRTHttpHeader *pHeader, OSRTHttpContent *pContent)
This function receives any HTTP content indicated by the response header.
Run-time context structure.
Definition: rtxContext.h:198
EXTERNRT int rtxHttpRecvRespHdr(OSRTNETCONN *pNetConn, OSRTHttpHeader *pHeader)
This function receives the initial header returned from an HTTP request.
EXTERNRT int rtxHttpGet(OSCTXT *pctxt, const char *url, OSRTHttpContent *pContent)
This function executes a full synchronous HTTP GET request.
EXTERNRT int rtxHttpRecvContent(OSRTNETCONN *pNetConn, OSRTHttpHeader *pHeader, OSRTHttpContent *pContent)
This function receives HTTP content.