libdas2
das2 core C utilities
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Data Fields
DasHttpResp Struct Reference

#include <das2/http.h>

Detailed Description

Encapsulates the status of a HTTP resource request.

Public Member Functions

void DasHttpResp_clear (DasHttpResp *pRes)
 Initialize all fields in an http response to default values. More...
 
bool DasHttpResp_init (DasHttpResp *pRes, const char *sUrl)
 Initialize the das_url component of an HTTP response. More...
 
bool DasHttpResp_useSsl (DasHttpResp *pRes)
 Returns true if the response is an SSL (Secure Socket Layer) connection.
 

Data Fields

int nSockFd
 The socket file descriptor that can be used to read the message body. More...
 
void * pSsl
 The SSL Connection if using HTTPS. More...
 
int nCode
 The HTTP status code returned by the server (if any)
 
char * sError
 An error message created by the library if a problem occurred.
 
char * sHeaders
 The full HTTP header set from the final response.
 
char * pMime
 The parsed out mime-type string from the headers.
 
char * sFilename
 The filename (if any) provided for the message body.
 
struct das_url url
 The parsed URL structure that was used to make the connection.
 

Member Function Documentation

void DasHttpResp_clear ( DasHttpResp pRes)

Initialize all fields in an http response to default values.

All char fields are set to zero, the file descriptor (nSockFd) is set to -1 and the response code is set to zero. This function is called automatically by http_getBodySocket() so there is usually no need to use it directly.

Parameters
pResThe response to clear
bool DasHttpResp_init ( DasHttpResp pRes,
const char *  sUrl 
)

Initialize the das_url component of an HTTP response.

The URL will be parsed into a das_url structure and stored internally.

Parameters
pResThe response to initialized
sUrlThe fully qualified URL including the scheme, host, port (if any), path and query parameters.

Field Documentation

int nSockFd

The socket file descriptor that can be used to read the message body.

A value of -1 indicates that the connection could not be made if pSsl is also NULL

void* pSsl

The SSL Connection if using HTTPS.

If both this value and nSockFd are null it means the connection failed


The documentation for this struct was generated from the following file: