Fusion Framework logo by Cipher UnitFusion

Headers

Header name constants, media types, fingerprint headers, and helpers

Overview

Header helpers live in fusion-core and are exposed as:

LanguageModule
Pythonfrom fusion_framework import header (or fusion_framework.header)
TypeScript / Nodeimport { header } from "fusion-framework"
C#Header static helpers / constants on FusionFramework

Use them when building response envelopes:

return self.response(
    body,
    status=status.HTTP_SUCCESS,
    headers=header.download("report.csv", header.TEXT_CSV),
)

Fingerprint headers

When fingerprinting is enabled (fingerprint.enabled, default true), responses can include:

ConstantTypical value
X_POWERED_BYFusion Framework (FRAMEWORK_POWERED_BY)
X_FRAMEWORKFusion (FRAMEWORK_ID)
X_FUSION_VERSIONcurrent framework version string

Helper builders

HelperResult
attachment(filename)Content-Disposition: attachment; filename=…
inline(filename?)Content-Disposition: inline…
content_type(media_type, charset?)Content-Type map
location(url)Location map
cache_control(value)Cache-Control map
download(filename, media_type?)attachment + Content-Type (default application/octet-stream)

Filenames are basenamed (path stripped) and escaped to avoid header injection.

Header name constants

ConstantHeader name
ACCEPTAccept
ACCEPT_ENCODINGAccept-Encoding
ACCEPT_LANGUAGEAccept-Language
AUTHORIZATIONAuthorization
CACHE_CONTROLCache-Control
CONNECTIONConnection
CONTENT_DISPOSITIONContent-Disposition
CONTENT_ENCODINGContent-Encoding
CONTENT_LENGTHContent-Length
CONTENT_RANGEContent-Range
CONTENT_TYPEContent-Type
COOKIECookie
DATEDate
ETAGETag
EXPECTExpect
EXPIRESExpires
HOSTHost
IF_MATCHIf-Match
IF_MODIFIED_SINCEIf-Modified-Since
IF_NONE_MATCHIf-None-Match
IF_RANGEIf-Range
IF_UNMODIFIED_SINCEIf-Unmodified-Since
LAST_MODIFIEDLast-Modified
LOCATIONLocation
ORIGINOrigin
PRAGMAPragma
RANGERange
REFERERReferer
RETRY_AFTERRetry-After
SERVERServer
SET_COOKIESet-Cookie
TETE
TRAILERTrailer
TRANSFER_ENCODINGTransfer-Encoding
UPGRADEUpgrade
USER_AGENTUser-Agent
VARYVary
VIAVia
WARNINGWarning
WWW_AUTHENTICATEWWW-Authenticate
X_CONTENT_TYPE_OPTIONSX-Content-Type-Options
X_FRAME_OPTIONSX-Frame-Options
X_REQUESTED_WITHX-Requested-With
X_FORWARDED_FORX-Forwarded-For
X_FORWARDED_PROTOX-Forwarded-Proto
X_REAL_IPX-Real-IP
ACCESS_CONTROL_ALLOW_ORIGINAccess-Control-Allow-Origin
ACCESS_CONTROL_ALLOW_METHODSAccess-Control-Allow-Methods
ACCESS_CONTROL_ALLOW_HEADERSAccess-Control-Allow-Headers
ACCESS_CONTROL_ALLOW_CREDENTIALSAccess-Control-Allow-Credentials
ACCESS_CONTROL_EXPOSE_HEADERSAccess-Control-Expose-Headers
ACCESS_CONTROL_MAX_AGEAccess-Control-Max-Age
ACCESS_CONTROL_REQUEST_METHODAccess-Control-Request-Method
ACCESS_CONTROL_REQUEST_HEADERSAccess-Control-Request-Headers
X_POWERED_BYX-Powered-By
X_FRAMEWORKX-Framework
X_FUSION_VERSIONX-Fusion-Version

Media-type / value constants

Also on the same header surface (and HTTP_HEADER_CONSTANTS):

ConstantValue
APPLICATION_JSONapplication/json
APPLICATION_JSON_UTF8application/json; charset=utf-8
APPLICATION_OCTET_STREAMapplication/octet-stream
APPLICATION_PDFapplication/pdf
APPLICATION_XMLapplication/xml
APPLICATION_FORM_URLENCODEDapplication/x-www-form-urlencoded
MULTIPART_FORM_DATAmultipart/form-data
TEXT_PLAINtext/plain
TEXT_PLAIN_UTF8text/plain; charset=utf-8
TEXT_HTMLtext/html
TEXT_HTML_UTF8text/html; charset=utf-8
TEXT_CSStext/css
TEXT_CSVtext/csv
TEXT_JAVASCRIPTtext/javascript
IMAGE_PNGimage/png
IMAGE_JPEGimage/jpeg
IMAGE_GIFimage/gif
IMAGE_WEBPimage/webp
IMAGE_SVGimage/svg+xml
ConstantValue
FRAMEWORK_POWERED_BYFusion Framework
FRAMEWORK_IDFusion

Source: crates/fusion-core/src/headers.rs.

On this page