Gnome XML Library Reference Manual
<<< Previous Page | Home | Up | Next Page >>>

# nanohttp

## Name

nanohttp --

## Synopsis

    void        xmlNanoHTTPInit                 (void);
    void        xmlNanoHTTPCleanup              (void);
    void        xmlNanoHTTPScanProxy            (const char *URL);
    int         xmlNanoHTTPFetch                (const char *URL,
                                                 const char *filename,
                                                 char **contentType);
    void*       xmlNanoHTTPMethod               (const char *URL,
                                                 const char *method,
                                                 const char *input,
                                                 char **contentType,
                                                 const char *headers,
                                                 int ilen);
    void*       xmlNanoHTTPMethodRedir          (const char *URL,
                                                 const char *method,
                                                 const char *input,
                                                 char **contentType,
                                                 char **redir,
                                                 const char *headers,
                                                 int ilen);
    void*       xmlNanoHTTPOpen                 (const char *URL,
                                                 char **contentType);
    void*       xmlNanoHTTPOpenRedir            (const char *URL,
                                                 char **contentType,
                                                 char **redir);
    int         xmlNanoHTTPReturnCode           (void *ctx);
    const char* xmlNanoHTTPAuthHeader           (void *ctx);
    int         xmlNanoHTTPRead                 (void *ctx,
                                                 void *dest,
                                                 int len);
    int         xmlNanoHTTPSave                 (void *ctxt,
                                                 const char *filename);
    void        xmlNanoHTTPClose                (void *ctx);

## Description

## Details

### xmlNanoHTTPInit ()

    void        xmlNanoHTTPInit                 (void);

Initialize the HTTP protocol layer. Currently it just checks for proxy informations

### xmlNanoHTTPCleanup ()

    void        xmlNanoHTTPCleanup              (void);

Cleanup the HTTP protocol layer.

### xmlNanoHTTPScanProxy ()

    void        xmlNanoHTTPScanProxy            (const char *URL);

(Re)Initialize the HTTP Proxy context by parsing the URL and finding the protocol host port it indicates. Should be like http://myproxy/ or http://myproxy:3128/ A NULL URL cleans up proxy informations.

`URL` : |

### xmlNanoHTTPFetch ()

    int         xmlNanoHTTPFetch                (const char *URL,
                                                 const char *filename,
                                                 char **contentType);

This function try to fetch the indicated resource via HTTP GET and save it's content in the file.

`URL` : |
`filename` : |
`contentType` : |
Returns : |

### xmlNanoHTTPMethod ()

    void*       xmlNanoHTTPMethod               (const char *URL,
                                                 const char *method,
                                                 const char *input,
                                                 char **contentType,
                                                 const char *headers,
                                                 int ilen);

This function try to open a connection to the indicated resource via HTTP using the given `method`, adding the given extra headers and the input buffer for the request content.

`URL` : |
`method` : |
`input` : |
`contentType` : |
`headers` : |
`ilen` : |

### xmlNanoHTTPMethodRedir ()

    void*       xmlNanoHTTPMethodRedir          (const char *URL,
                                                 const char *method,
                                                 const char *input,
                                                 char **contentType,
                                                 char **redir,
                                                 const char *headers,
                                                 int ilen);

This function try to open a connection to the indicated resource via HTTP using the given `method`, adding the given extra headers and the input buffer for the request content.

`URL` : |
`method` : |
`input` : |
`contentType` : |
`redir` : |
`headers` : |
`ilen` : |

### xmlNanoHTTPOpen ()

    void*       xmlNanoHTTPOpen                 (const char *URL,
                                                 char **contentType);

This function try to open a connection to the indicated resource via HTTP GET.

`URL` : |
`contentType` : |

### xmlNanoHTTPOpenRedir ()

    void*       xmlNanoHTTPOpenRedir            (const char *URL,
                                                 char **contentType,
                                                 char **redir);

This function try to open a connection to the indicated resource via HTTP GET.

`URL` : |
`contentType` : |
`redir` : |

### xmlNanoHTTPReturnCode ()

    int         xmlNanoHTTPReturnCode           (void *ctx);

Get the latest HTTP return code received

`ctx` : |
Returns : |

### xmlNanoHTTPAuthHeader ()

    const char* xmlNanoHTTPAuthHeader           (void *ctx);

Get the authentication header of an HTTP context

`ctx` : |
Returns : |

### xmlNanoHTTPRead ()

    int         xmlNanoHTTPRead                 (void *ctx,
                                                 void *dest,
                                                 int len);

This function tries to read `len` bytes from the existing HTTP connection and saves them in `dest`. This is a blocking call.

`ctx` : |
`dest` : |
`len` : |
Returns : |

### xmlNanoHTTPSave ()

    int         xmlNanoHTTPSave                 (void *ctxt,
                                                 const char *filename);

This function saves the output of the HTTP transaction to a file It closes and free the context at the end

`ctxt` : |
`filename` : |
Returns : |

### xmlNanoHTTPClose ()

    void        xmlNanoHTTPClose                (void *ctx);

This function closes an HTTP context, it ends up the connection and free all data related to it.

`ctx` : |

<<< Previous Page | Home | Up | Next Page >>>
xinclude | nanoftp