e2k-http-utils

## e2k-http-utils e2k-http-utils — HTTP utility functions |

## Synopsis

    typedef             E2kHTTPStatus;
    #define             E2K_HTTP_STATUS_IS_TRANSPORT_ERROR  (status)
    #define             E2K_HTTP_STATUS_IS_INFORMATIONAL    (status)
    #define             E2K_HTTP_STATUS_IS_SUCCESSFUL       (status)
    #define             E2K_HTTP_STATUS_IS_REDIRECTION      (status)
    #define             E2K_HTTP_STATUS_IS_CLIENT_ERROR     (status)
    #define             E2K_HTTP_STATUS_IS_SERVER_ERROR     (status)

    time_t              e2k_http_parse_date                 (const gchar *date);
    E2kHTTPStatus       e2k_http_parse_status               (const gchar *status_line);
    const gchar *       e2k_http_accept_language            (void);

## Description

## Details

### E2kHTTPStatus

### E2K_HTTP_STATUS_IS_TRANSPORT_ERROR()

    #define             E2K_HTTP_STATUS_IS_TRANSPORT_ERROR(status)

`status` : |

### E2K_HTTP_STATUS_IS_INFORMATIONAL()

    #define             E2K_HTTP_STATUS_IS_INFORMATIONAL(status)

`status` : |

### E2K_HTTP_STATUS_IS_SUCCESSFUL()

    #define             E2K_HTTP_STATUS_IS_SUCCESSFUL(status)

`status` : |

### E2K_HTTP_STATUS_IS_REDIRECTION()

    #define             E2K_HTTP_STATUS_IS_REDIRECTION(status)

`status` : |

### E2K_HTTP_STATUS_IS_CLIENT_ERROR()

    #define             E2K_HTTP_STATUS_IS_CLIENT_ERROR(status)

`status` : |

### E2K_HTTP_STATUS_IS_SERVER_ERROR()

    #define             E2K_HTTP_STATUS_IS_SERVER_ERROR(status)

`status` : |

### e2k_http_parse_date ()

    time_t              e2k_http_parse_date                 (const gchar *date);

Converts an HTTP Date header into a time_t value. Doesn't do much sanity checking on the format since we know IIS always returns the date in RFC 1123 format, not either of the other two allowable formats.

`date` : | an HTTP Date header, returned from Exchange
Returns : | a `time_t` corresponding to `date`.

### e2k_http_parse_status ()

    E2kHTTPStatus       e2k_http_parse_status               (const gchar *status_line);

Parses an HTTP Status-Line and returns the Status-Code

`status_line` : | an HTTP Status-Line
Returns : | the Status-Code portion of `status_line`

### e2k_http_accept_language ()

    const gchar *       e2k_http_accept_language            (void);

Generates an Accept-Language value to send to the Exchange server. The user's default folders (Inbox, Calendar, etc) are not created until the user connects to Exchange for the first time, and in that case, it needs to know what language to name the folders in. libexchange users are responsible for setting the Accept-Language header on any request that could be the first-ever request to a mailbox. (Exchange will return 401 Unauthorized if it receives a request with no Accept-Language header for an uninitialized mailbox.)

Returns : | an Accept-Language string.