Module mod_ocs_rest_accepted_content
Handle media type validation in HTTP requests.
Copyright © 2016 - 2026 SigScale Global Inc.
Handle media type validation in HTTP requests.
This is an httpd callback module handling
media type validation of HTTP operations. The HTTP resources are
managed in modules named ocs_rest_res_*.
The resource handler modules should implement the following
callback functions.
content_types_provided() -> ContentTypes
- ContentTypes = [ContentType]
- ContentType = string()
Provides the list of possible media types in response bodies
provided by functions in the resource handler module.
content_types_accepted() -> ContentTypes
- ContentTypes = [ContentType]
- ContentType = string()
Provides the list of possible media types accepted in bodies
provided to functions in the resource handler module.
do(ModData) -> Result
- ModData = #mod{}
- Result = {proceed, OldData} | {proceed, NewData} | {break, NewData} | done
- OldData = list()
- NewData = [{response, {StatusCode, Body}}] | [{response, {response, Head, Body}}] | [{response, {already_sent, StatusCode, Size}}]
- StatusCode = integer()
- Body = iolist() | nobody | {Fun, Arg}
- Head = [HeaderOption]
- HeaderOption = {Option, Value} | {code, StatusCode}
- Option = accept_ranges | allow | cache_control | content_MD5 | content_encoding | content_language | content_length | content_location | content_range | content_type | date | etag | expires | last_modified | location | pragma | retry_after | server | trailer | transfer_encoding
- Value = string()
- Size = term()
- Fun = fun((Arg) -> sent | close | Body)
- Arg = [term()]
Generated by EDoc