XBinder  Version 2.6.x
rtxHttp.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2003-2018 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 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
58 EXTERNRT int rtxHttpConnect (OSRTNETCONN* pNetConn);
59 
71 EXTERNRT int rtxHttpGet
72 (OSCTXT* pctxt, const char* url, OSRTHttpContent* pContent);
73 
82 EXTERNRT int rtxHttpSendGetRequest (OSRTNETCONN* pNetConn, const char* url);
83 
93 EXTERNRT int rtxHttpSendRequest (OSRTNETCONN* pNetConn,
94  const char* method, const char* content, const char* contentType);
95 
105 EXTERNRT int rtxHttpRecvRespHdr
106 (OSRTNETCONN* pNetConn, OSRTHttpHeader* pHeader);
107 
118 EXTERNRT int rtxHttpRecvContent
119 (OSRTNETCONN* pNetConn, OSRTHttpHeader* pHeader, OSRTHttpContent* pContent);
120 
132 EXTERNRT int rtxHttpRecvRespContent
133 (OSRTNETCONN* pNetConn, OSRTHttpHeader* pHeader, OSRTHttpContent* pContent);
134 
135 #ifdef _TRACE
136 
143 void rtxDiagPrintHttpHeader (OSCTXT* pctxt, const OSRTHttpHeader* pHeader);
144 #endif
145 
146 #ifdef __cplusplus
147 }
148 #endif
149 
150 #endif /* _OS_NOSOCKET */
151 
152 #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 rtxHttpConnect(OSRTNETCONN *pNetConn)
This function executes a full synchronous HTTP CONNECT request to setup a connection through a proxy...
EXTERNRT int rtxHttpSendGetRequest(OSRTNETCONN *pNetConn, const char *url)
This function sends an HTTP GET request to a network connection.
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:185
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.