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
}

Enumeration of HTTP server response types.

enum
SL_HTTP_VERSION_1_0
SL_HTTP_VERSION_1_1
}

Enumeration of HTTP request versions.

enum
SL_HTTP_REQUEST_GET
SL_HTTP_REQUEST_POST
SL_HTTP_REQUEST_PUT
SL_HTTP_REQUEST_DELETE
SL_HTTP_REQUEST_HEAD
}

Enumeration of HTTP server request types.

Macros#

#define

MIME type for CSS files.

#define

MIME type for CSV files.

#define

MIME type for HTML files.

#define

MIME type for JavaScript files.

#define

MIME type for plain text files.

#define

MIME type for XML files.

#define

MIME type for PDF files.

#define

MIME type for JSON files.

#define

MIME type for XML files.

#define

Maximum number of query parameters in a URI.

#define

Maximum length of the header buffer.

Enumeration Documentation#

sl_http_response_code_t#

sl_http_response_code_t

Enumeration of HTTP server response types.

This enumeration defines the standard HTTP/1.1 response status codes used by the HTTP server to indicate the result of a client's request.

Note

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

Enumerator
SL_HTTP_RESPONSE_OK

Success response code (200 OK)

SL_HTTP_RESPONSE_BAD_REQUEST

Bad request response code (400 Bad Request)

SL_HTTP_RESPONSE_UNAUTHORIZED

Unauthorized response code (401 Unauthorized)

SL_HTTP_RESPONSE_FORBIDDEN

Forbidden response code (403 Forbidden)

SL_HTTP_RESPONSE_NOT_FOUND

Not found response code (404 Not Found)

SL_HTTP_RESPONSE_METHOD_NOT_ALLOWED

Method not allowed response code (405 Method Not Allowed)

SL_HTTP_RESPONSE_INTERNAL_SERVER_ERROR

Internal server error response code (500 Internal Server Error)

SL_HTTP_RESPONSE_NOT_IMPLEMENTED

Not implemented response code (501 Not Implemented)

SL_HTTP_RESPONSE_SERVICE_UNAVAILABLE

Service unavailable response code (503 Service Unavailable)

SL_HTTP_RESPONSE_HTTP_VERSION_NOT_SUPPORTED

HTTP version not supported response code (505 HTTP Version Not Supported)


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

sl_http_request_version_t#

sl_http_request_version_t

Enumeration of HTTP request versions.

This enumeration defines the supported versions of the HTTP protocol that can be used in HTTP requests.

Enumerator
SL_HTTP_VERSION_1_0

HTTP Version 1.0.

SL_HTTP_VERSION_1_1

HTTP Version 1.1.


Definition at line 180 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

Enumeration of HTTP server request types.

This enumeration defines the types of HTTP requests that the server can handle. Each request type corresponds to a standard HTTP method.

Enumerator
SL_HTTP_REQUEST_GET

GET request type, used to retrieve data from the server.

SL_HTTP_REQUEST_POST

POST request type, used to submit data to the server.

SL_HTTP_REQUEST_PUT

PUT request type, used to update or create a resource on the server.

SL_HTTP_REQUEST_DELETE

DELETE request type, used to delete a resource from the server.

SL_HTTP_REQUEST_HEAD

HEAD request type, used to retrieve the headers for a resource, without the body.


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

Macro Definition Documentation#

SL_HTTP_CONTENT_TYPE_TEXT_CSS#

#define SL_HTTP_CONTENT_TYPE_TEXT_CSS
Value:
"text/css"

MIME type for CSS files.

This macro defines the MIME (Multipurpose Internet Mail Extensions) type for Cascading Style Sheets (CSS) files. It is used in HTTP headers to specify the content type of the response.


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

SL_HTTP_CONTENT_TYPE_TEXT_CSV#

#define SL_HTTP_CONTENT_TYPE_TEXT_CSV
Value:
"text/csv"

MIME type for CSV files.

This macro defines the MIME (Multipurpose Internet Mail Extensions) type for Comma-Separated Values (CSV) files. It is used in HTTP headers to specify the content type of the response.


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

SL_HTTP_CONTENT_TYPE_TEXT_HTML#

#define SL_HTTP_CONTENT_TYPE_TEXT_HTML
Value:
"text/html"

MIME type for HTML files.

This macro defines the MIME (Multipurpose Internet Mail Extensions) type for HyperText Markup Language (HTML) files. It is used in HTTP headers to specify the content type of the response.


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

SL_HTTP_CONTENT_TYPE_TEXT_JAVASCRIPT#

#define SL_HTTP_CONTENT_TYPE_TEXT_JAVASCRIPT
Value:
"text/javascript"

MIME type for JavaScript files.

This macro defines the MIME (Multipurpose Internet Mail Extensions) type for JavaScript files. It is used in HTTP headers to specify the content type of the response.


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

SL_HTTP_CONTENT_TYPE_TEXT_PLAIN#

#define SL_HTTP_CONTENT_TYPE_TEXT_PLAIN
Value:
"text/plain"

MIME type for plain text files.

This macro defines the MIME (Multipurpose Internet Mail Extensions) type for plain text files. It is used in HTTP headers to specify the content type of the response.


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

SL_HTTP_CONTENT_TYPE_TEXT_XML#

#define SL_HTTP_CONTENT_TYPE_TEXT_XML
Value:
"text/xml"

MIME type for XML files.

This macro defines the MIME (Multipurpose Internet Mail Extensions) type for Extensible Markup Language (XML) files. It is used in HTTP headers to specify the content type of the response.


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

SL_HTTP_CONTENT_TYPE_APPLICATION_PDF#

#define SL_HTTP_CONTENT_TYPE_APPLICATION_PDF
Value:
"application/pdf"

MIME type for PDF files.

This macro defines the MIME (Multipurpose Internet Mail Extensions) type for Portable Document Format (PDF) files. It is used in HTTP headers to specify the content type of the response.


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

SL_HTTP_CONTENT_TYPE_APPLICATION_JSON#

#define SL_HTTP_CONTENT_TYPE_APPLICATION_JSON
Value:
"application/json"

MIME type for JSON files.

This macro defines the MIME (Multipurpose Internet Mail Extensions) type for JavaScript Object Notation (JSON) files. It is used in HTTP headers to specify the content type of the response.


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

SL_HTTP_CONTENT_TYPE_APPLICATION_XML#

#define SL_HTTP_CONTENT_TYPE_APPLICATION_XML
Value:
"application/xml"

MIME type for XML files.

This macro defines the MIME (Multipurpose Internet Mail Extensions) type for Extensible Markup Language (XML) files. It is used in HTTP headers to specify the content type of the response.


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

MAX_QUERY_PARAMETERS#

#define MAX_QUERY_PARAMETERS
Value:
4

Maximum number of query parameters in a URI.

This macro defines the maximum number of query parameters that can be included in a Uniform Resource Identifier (URI) for an HTTP request. It is used to limit the number of parameters that the server will process.


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

MAX_HEADER_BUFFER_LENGTH#

#define MAX_HEADER_BUFFER_LENGTH
Value:
1024

Maximum length of the header buffer.

This macro defines the maximum length, in bytes, of the buffer used to store HTTP headers. It is used to ensure that the buffer allocated for headers is sufficiently large to handle typical HTTP requests and responses.


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