Files | |
file | webclient.c |
Implementation of the HTTP client. | |
file | webclient.h |
Header file for the HTTP client. | |
Functions | |
void | webclient_datahandler (char *data, u16_t len) |
Callback function that is called from the webclient code when HTTP data has been received. | |
void | webclient_connected (void) |
Callback function that is called from the webclient code when the HTTP connection has been connected to the web server. | |
void | webclient_timedout (void) |
Callback function that is called from the webclient code if the HTTP connection to the web server has timed out. | |
void | webclient_aborted (void) |
Callback function that is called from the webclient code if the HTTP connection to the web server has been aborted by the web server. | |
void | webclient_closed (void) |
Callback function that is called from the webclient code when the HTTP connection to the web server has been closed. | |
void | webclient_init (void) |
Initialize the webclient module. | |
unsigned char | webclient_get (char *host, u16_t port, char *file) |
Open an HTTP connection to a web server and ask for a file using the GET method. | |
void | webclient_close (void) |
Close the currently open HTTP connection. | |
char * | webclient_mimetype (void) |
Obtain the MIME type of the current HTTP data stream. | |
char * | webclient_filename (void) |
Obtain the filename of the current HTTP data stream. | |
char * | webclient_hostname (void) |
Obtain the hostname of the current HTTP data stream. | |
unsigned short | webclient_port (void) |
Obtain the port number of the current HTTP data stream. |
|
Callback function that is called from the webclient code if the HTTP connection to the web server has been aborted by the web server. This function must be implemented by the module that uses the webclient code. |
|
Callback function that is called from the webclient code when the HTTP connection to the web server has been closed. This function must be implemented by the module that uses the webclient code. |
|
Callback function that is called from the webclient code when the HTTP connection has been connected to the web server. This function must be implemented by the module that uses the webclient code. |
|
Callback function that is called from the webclient code when HTTP data has been received. This function must be implemented by the module that uses the webclient code. The function is called from the webclient module when HTTP data has been received. The function is not called when HTTP headers are received, only for the actual data.
|
|
Obtain the filename of the current HTTP data stream. The filename of an HTTP request may be changed by the web server, and may therefore not be the same as when the original GET request was made with webclient_get(). This function is used for obtaining the current filename.
|
|
Open an HTTP connection to a web server and ask for a file using the GET method. This function opens an HTTP connection to the specified web server and requests the specified file using the GET method. When the HTTP connection has been connected, the webclient_connected() callback function is called and when the HTTP data arrives the webclient_datahandler() callback function is called. The callback function webclient_timedout() is called if the web server could not be contacted, and the webclient_aborted() callback function is called if the HTTP connection is aborted by the web server. When the HTTP request has been completed and the HTTP connection is closed, the webclient_closed() callback function will be called.
|
Here is the call graph for this function:
|
Obtain the hostname of the current HTTP data stream. The hostname of the web server of an HTTP request may be changed by the web server, and may therefore not be the same as when the original GET request was made with webclient_get(). This function is used for obtaining the current hostname.
|
|
Obtain the MIME type of the current HTTP data stream.
|
|
Obtain the port number of the current HTTP data stream. The port number of an HTTP request may be changed by the web server, and may therefore not be the same as when the original GET request was made with webclient_get(). This function is used for obtaining the current port number.
|
|
Callback function that is called from the webclient code if the HTTP connection to the web server has timed out. This function must be implemented by the module that uses the webclient code. |