websError GoAhead WebServer API GoAhead EMF

Synopsis

Return an error message to the requesting browser.

Prototype

 #include "webs.h"
 
 void websError(webs_t wp, int code, char_t *msg, ...); 

Parameters

wp Web server connection handle.
code HTTP response code (see websDone for codes).
msg Message format string with %s and %d parameters.
... Parameters for %s and %d directives.

Description

The websError procedure can be used to return a request response to the user's browser and then close the connection. It internally calls websDone to close the connection. You can use it as you would a printf call with a message format string.

Return Value

None

Example

 websError(wp, 200, "Can't open %s", filename); 

Stability Classification

Stable.

See Also

websDone