HTTP Server#

This module contains the HTTP Server API constants.

Enumerations#

enum
SL_HTTP_RESPONSE_OK = 200
SL_HTTP_RESPONSE_BAD_REQUEST = 400
SL_HTTP_RESPONSE_UNAUTHORIZED = 401
SL_HTTP_RESPONSE_FORBIDDEN = 403
SL_HTTP_RESPONSE_NOT_FOUND = 404
SL_HTTP_RESPONSE_METHOD_NOT_ALLOWED = 405
SL_HTTP_RESPONSE_INTERNAL_SERVER_ERROR = 500
SL_HTTP_RESPONSE_NOT_IMPLEMENTED = 501
SL_HTTP_RESPONSE_SERVICE_UNAVAILABLE = 503
SL_HTTP_RESPONSE_HTTP_VERSION_NOT_SUPPORTED = 505
}

HTTP server response types.

enum
SL_HTTP_VERSION_1_0
SL_HTTP_VERSION_1_1
}

HTTP request versions.

enum
SL_HTTP_REQUEST_GET
SL_HTTP_REQUEST_POST
SL_HTTP_REQUEST_PUT
SL_HTTP_REQUEST_DELETE
SL_HTTP_REQUEST_HEAD
}

HTTP server request types.

Macros#

#define
SL_HTTP_CONTENT_TYPE_TEXT_CSS "text/css"

Content type for CSS files.

#define
SL_HTTP_CONTENT_TYPE_TEXT_CSV "text/csv"

Content type for CSV files.

#define
SL_HTTP_CONTENT_TYPE_TEXT_HTML "text/html"

Content type for HTML files.

#define
SL_HTTP_CONTENT_TYPE_TEXT_JAVASCRIPT "text/javascript"

Content type for JavaScript files.

#define
SL_HTTP_CONTENT_TYPE_TEXT_PLAIN "text/plain"

Content type for plain text files.

#define
SL_HTTP_CONTENT_TYPE_TEXT_XML "text/xml"

Content type for XML files.

#define
SL_HTTP_CONTENT_TYPE_APPLICATION_PDF "application/pdf"

Content type for PDF files.

#define
SL_HTTP_CONTENT_TYPE_APPLICATION_PDF "application/pdf"

Content type for PDF files.

#define
SL_HTTP_CONTENT_TYPE_APPLICATION_JSON "application/json"

Content type for JSON files.

#define
SL_HTTP_CONTENT_TYPE_APPLICATION_XML "application/xml"

Content type for XML files.

#define
MAX_QUERY_PARAMETERS 4

Maximum number of query parameters in a URI.

#define
MAX_HEADER_BUFFER_LENGTH 1024

Maximum length of the header buffer.

Enumeration Documentation#

sl_http_response_code_t#

sl_http_response_code_t

HTTP server response types.

Note

  • These are the standard HTTP/1.1 response status codes.

Enumerator
SL_HTTP_RESPONSE_OK

Success response code.

SL_HTTP_RESPONSE_BAD_REQUEST

Bad request response code.

SL_HTTP_RESPONSE_UNAUTHORIZED

Unauthorized response code.

SL_HTTP_RESPONSE_FORBIDDEN

Forbidden response code.

SL_HTTP_RESPONSE_NOT_FOUND

Not found response code.

SL_HTTP_RESPONSE_METHOD_NOT_ALLOWED

Method not allowed response code.

SL_HTTP_RESPONSE_INTERNAL_SERVER_ERROR

Internal server error response code.

SL_HTTP_RESPONSE_NOT_IMPLEMENTED

Not implemented response code.

SL_HTTP_RESPONSE_SERVICE_UNAVAILABLE

Service unavailable response code.

SL_HTTP_RESPONSE_HTTP_VERSION_NOT_SUPPORTED

HTTP version not supported response code.


Definition at line 79 of file components/service/sl_http_server/inc/sl_http_server_types.h

sl_http_request_version_t#

sl_http_request_version_t

HTTP request versions.

Enumerator
SL_HTTP_VERSION_1_0

HTTP Version 1.0.

SL_HTTP_VERSION_1_1

HTTP Version 1.1.


Definition at line 95 of file components/service/sl_http_server/inc/sl_http_server_types.h

sl_http_server_request_type_t#

sl_http_server_request_type_t

HTTP server request types.

Enumerator
SL_HTTP_REQUEST_GET

GET request type.

SL_HTTP_REQUEST_POST

POST request type.

SL_HTTP_REQUEST_PUT

PUT request type.

SL_HTTP_REQUEST_DELETE

DELETE request type.

SL_HTTP_REQUEST_HEAD

HEAD request type.


Definition at line 103 of file components/service/sl_http_server/inc/sl_http_server_types.h