My fork of the HTTPServer (working)

Dependents:   DGWWebServer LAN2

Embed: (wiki syntax)

« Back to documentation index

HTTPServer Class Reference

The HTTPServer class. More...

#include <HTTPServer.h>

Inherits mbed::TCPListener.

Public Member Functions

 HTTPServer (u16_t=80)
 Create a new server instance by default on port 80.
virtual void addHandler (HTTPHandler *handler)
 Add a new content handler to handle requests.
virtual void registerField (char *name)
 Register needed header fields to filter from a request header.
virtual bool isField (unsigned long h) const
 A short lookup if the headerfield is registerd.

Static Public Member Functions

static void poll ()
 You have to call this method at least every 250ms to let the http server run.

Detailed Description

The HTTPServer class.

It representates the top class of an HTTPServer.

Definition at line 261 of file HTTPServer.h.


Constructor & Destructor Documentation

HTTPServer ( u16_t  port = 80 )

Create a new server instance by default on port 80.

Definition at line 342 of file HTTPServer.cpp.


Member Function Documentation

virtual void addHandler ( HTTPHandler handler ) [virtual]

Add a new content handler to handle requests.

Content handler are URL prefix specific. Have a look at HTTPRPC and HTTPFileSystemHandler for examples.

Definition at line 277 of file HTTPServer.h.

virtual bool isField ( unsigned long  h ) const [virtual]

A short lookup if the headerfield is registerd.

Definition at line 293 of file HTTPServer.h.

static void poll (  ) [static]

You have to call this method at least every 250ms to let the http server run.

But I would recomend to call this function as fast as possible. This function is directly coupled to the answere time of your HTTPServer instance.

Definition at line 302 of file HTTPServer.h.

virtual void registerField ( char *  name ) [virtual]

Register needed header fields to filter from a request header.

Should be called from HTTPHandler::reg()

Definition at line 286 of file HTTPServer.h.