Returning a standard web error to the browserΒΆ

web_status()

Return a standard web error to the browser


SYNTAX

web_status(integer)

Return the standard web error number integer to the web browser. The program must not put cookies or output headers before calling this function, nor may it execute a print or put statement.

Normally the program will exit after calling this function, but it may output HMTL code if required.

Web error numbers are defined in http.h with the prefix SC_ , and are as follows:

SC_CONTINUE

100

SC_SWITCHING_PROTOCOLS

101

SC_OK

200

SC_CREATED

201

SC_ACCEPTED

202

SC_NON_AUTHORITATIVE_INFORMATION

203

SC_NO_CONTENT

204

SC_RESET_CONTENT

205

SC_PARTIAL_CONTENT

206

SC_MULTIPLE_CHOICES

300

SC_MOVED_PERMANENTLY

301

SC_MOVED_TEMPORARILY

302

SC_SEE_OTHER

303

SC_NOT_MODIFIED

304

SC_USE_PROXY

305

SC_BAD_REQUEST

400

SC_UNAUTHORIZED

401

SC_PAYMENT_REQUIRED

402

SC_FORBIDDEN

403

SC_NOT_FOUND

404

SC_METHOD_NOT_ALLOWED

405

SC_NOT_ACCEPTABLE

406

SC_PROXY_AUTHENTICATION_REQUIRED

407

SC_REQUEST_TIMEOUT

408

SC_CONFLICT

409

SC_GONE

410

SC_LENGTH_REQUIRED

411

SC_PRECONDITION_FAILED

412

SC_REQUEST_ENTITY_TOO_LARGE

413

SC_REQUEST_URI_TOO_LONG

414

SC_UNSUPPORTED_MEDIA_TYPE

415

SC_INTERNAL_SERVER_ERROR

500

SC_NOT_IMPLEMENTED

501

SC_BAD_GATEWAY

502

SC_SERVICE_UNAVAILABLE

503

SC_GATEWAY_TIMEOUT

504

SC_HTTP_VERSION_NOT_SUPPORTED

505

The function returns 0 (OK), or a negative value to indicate an error. The only possible error for this function is WWW_ERR_NOT_IN_FIRST HEADER.


RELATED TOPICS

Creating web pages with Sculptor

Internet functions

Internet function error codes