36 #define DASURL_SZ_SCHEME 31
37 #define DASURL_SZ_HOST 63
38 #define DASURL_SZ_PATH 127
39 #define DASURL_SZ_QUERY 511
40 #define DASURL_SZ_DATASET 63
41 #define DASURL_SZ_PORT 7
44 bool das_http_init(
const char* sProgName);
45 void das_http_finish(
void);
58 #define DASHTTP_TO_MIN 2.0
59 #define DASHTTP_TO_MULTI 3.0
60 #define DASHTTP_TO_MAX 18.0
81 typedef struct das_http_response_t{
257 int64_t nLimit,
float rConSec
A dynamic buffer with multi-dimensional array style access.
Handle storing credentials during a Das2 session and optionally save them to a file.
DAS_API char * das_ssl_getErr(const void *vpSsl, int nRet)
Get a new string allocated on the heap explaining an SSL error or NULL in nRet == 0.
DAS_API bool das_http_getBody(const char *sUrl, const char *sAgent, DasCredMngr *pMgr, DasHttpResp *pRes, float rConSec)
Get a socket positioned at the start of a remote resource.
DAS_API DasAry * das_http_readUrl(const char *sUrl, const char *sAgent, DasCredMngr *pMgr, DasHttpResp *pRes, int64_t nLimit, float rConSec)
Read all the bytes for a URL into a byte array.
DAS_API void DasHttpResp_freeFields(DasHttpResp *pRes)
Free any fields that contain allocated memory This will not free the pRes structure itself,...
Dynamic recursive ragged arrays.
Definition: array.h:270
Credentials manager Handles a list of login credentials and supplies these as needed for network oper...
Definition: credentials.h:117
Encapsulates the status of a HTTP resource request.
Definition: http.h:81
char * pMime
The parsed out mime-type string from the headers.
Definition: http.h:102
char * sHeaders
The full HTTP header set from the final response.
Definition: http.h:99
DAS_API void DasHttpResp_clear(DasHttpResp *pRes)
Initialize all fields in an http response to default values.
void * pSsl
The SSL Connection if using HTTPS.
Definition: http.h:90
char * sError
An error message created by the library if a problem occurred.
Definition: http.h:96
int nSockFd
The socket file descriptor that can be used to read the message body.
Definition: http.h:86
DAS_API bool DasHttpResp_init(DasHttpResp *pRes, const char *sUrl)
Initialize the das_url component of an HTTP response.
char * sFilename
The filename (if any) provided for the message body.
Definition: http.h:105
DAS_API bool DasHttpResp_useSsl(DasHttpResp *pRes)
Returns true if the response is an SSL (Secure Socket Layer) connection.
int nCode
The HTTP status code returned by the server (if any)
Definition: http.h:93
A parsed URL structure.
Definition: http.h:64
char sHost[DASURL_SZ_HOST+1]
The host string.
Definition: http.h:68
char sDataset[DASURL_SZ_DATASET+1]
The dataset identified in the query string (if any)
Definition: http.h:74
char sPort[DASURL_SZ_PORT+1]
The port number used to make the request, saved as a string.
Definition: http.h:77
char sQuery[DASURL_SZ_QUERY+1]
The query string.
Definition: http.h:72
char sPath[DASURL_SZ_PATH+1]
The path on the host.
Definition: http.h:70
DAS_API bool das_url_toStr(const struct das_url *pUrl, char *sBuf, size_t uLen)
Convert a URL structure into a string.
char sScheme[DASURL_SZ_SCHEME+1]
The scheme string.
Definition: http.h:66