41 #define DASURL_SZ_SCHEME 31
42 #define DASURL_SZ_HOST 63
43 #define DASURL_SZ_PATH 127
44 #define DASURL_SZ_QUERY 511
45 #define DASURL_SZ_DATASET 63
48 bool das_http_init(
const char* sProgName);
61 #define DASHTTP_TO_MIN 2.0
62 #define DASHTTP_TO_MULTI 3.0
63 #define DASHTTP_TO_MAX 18.0
84 typedef struct das_http_response_t{
264 int64_t nLimit,
float rConSec
void DasHttpResp_clear(DasHttpResp *pRes)
Initialize all fields in an http response to default values.
char * pMime
The parsed out mime-type string from the headers.
Definition: http.h:105
char sScheme[DASURL_SZ_SCHEME+1]
The scheme string.
Definition: http.h:69
char sDataset[DASURL_SZ_DATASET+1]
The dataset identified in the query string (if any)
Definition: http.h:77
char sPath[DASURL_SZ_PATH+1]
The path on the host.
Definition: http.h:73
Credentials manager Handles a list of login credentials and supplies these as needed for network oper...
Definition: credentials.h:94
Encapsulates the status of a HTTP resource request.
Definition: http.h:84
char sPort[8]
The port number used to make the request, saved as a string.
Definition: http.h:80
A dynamic buffer with multi-dimensional array style access.
char sHost[DASURL_SZ_HOST+1]
The host string.
Definition: http.h:71
bool DasHttpResp_useSsl(DasHttpResp *pRes)
Returns true if the response is an SSL (Secure Socket Layer) connection.
char * sError
An error message created by the library if a problem occurred.
Definition: http.h:99
char * sHeaders
The full HTTP header set from the final response.
Definition: http.h:102
int nSockFd
The socket file descriptor that can be used to read the message body.
Definition: http.h:89
Handle storing credentials during a Das2 session and optionally save them to a file.
bool DasHttpResp_init(DasHttpResp *pRes, const char *sUrl)
Initialize the das_url component of an HTTP response.
void * pSsl
The SSL Connection if using HTTPS.
Definition: http.h:93
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.
void DasHttpResp_freeFields(DasHttpResp *pRes)
Free any fields that contain allocated memory This will not free the pRes structure itself...
char sQuery[DASURL_SZ_QUERY+1]
The query string.
Definition: http.h:75
char * sFilename
The filename (if any) provided for the message body.
Definition: http.h:108
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...
bool das_url_toStr(const struct das_url *pUrl, char *sBuf, size_t uLen)
Convert a URL structure into a string.
A parsed URL structure.
Definition: http.h:67
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.
int nCode
The HTTP status code returned by the server (if any)
Definition: http.h:96
Dynamic recursive ragged arrays.
Definition: array.h:193