Last active
January 28, 2025 08:28
-
-
Save montasim/c617ab1e4dba33de7d01063f5b0175a7 to your computer and use it in GitHub Desktop.
Revisions
-
montasim revised this gist
Jan 28, 2025 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,7 +18,7 @@ * An object representing different content types. * @enum {string} */ const contentTypesConstants = Object.freeze({ /** * JSON content type - Used for sending and receiving JSON-encoded data. * Example: A REST API response containing user data in JSON format. @@ -172,6 +172,6 @@ const contentTypesConstants = { * @type {string} */ VIDEO_OGG: 'video/ogg', }); export default contentTypesConstants; -
montasim revised this gist
Jan 28, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ * * @module constants/contentTypes * @version 1.0.0 * @license CC BY-NC-ND 4.0 * * @contact Mohammad Montasim-Al-Mamun Shuvo * @created 2025-01-28 -
montasim revised this gist
Jan 28, 2025 . 1 changed file with 111 additions and 23 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ * @version 1.0.0 * @license MIT * * @contact Mohammad Montasim-Al-Mamun Shuvo * @created 2025-01-28 * @contactEmail [email protected] * @contactGithub https://github.com/montasim @@ -19,70 +19,158 @@ * @enum {string} */ const contentTypesConstants = { /** * JSON content type - Used for sending and receiving JSON-encoded data. * Example: A REST API response containing user data in JSON format. * @type {string} */ JSON: 'application/json', /** * Form data content type - Used for submitting form data that includes files. * Example: A file upload form that sends an image file to the server. * @type {string} */ FORM_DATA: 'multipart/form-data', /** * URL encoded form data content type - Used for submitting form data in URL-encoded format. * Example: A login form that sends username and password data. * @type {string} */ X_WWW_FORM_URLENCODED: 'application/x-www-form-urlencoded', /** * Plain text content type - Used for sending plain text data. * Example: A log message sent to a server as plain text. * @type {string} */ TEXT_PLAIN: 'text/plain', /** * HTML content type - Used for sending HTML content. * Example: A server sends an HTML page as the response to a browser request. * @type {string} */ TEXT_HTML: 'text/html', /** * XML content type - Used for sending XML-encoded data. * Example: A SOAP API request containing an XML payload. * @type {string} */ APPLICATION_XML: 'application/xml', /** * JavaScript content type - Used for serving JavaScript files. * Example: A server sends a JavaScript file requested by a web browser. * @type {string} */ APPLICATION_JAVASCRIPT: 'application/javascript', /** * CSS content type - Used for serving CSS files. * Example: A server sends a CSS file requested by a web browser. * @type {string} */ TEXT_CSS: 'text/css', /** * CSV content type - Used for sending or downloading data in CSV format. * Example: A server provides an export of user data as a CSV file. * @type {string} */ TEXT_CSV: 'text/csv', /** * Binary data content type - Used for sending arbitrary binary data. * Example: A server sends a binary file such as an executable or image file. * @type {string} */ APPLICATION_OCTET_STREAM: 'application/octet-stream', /** * PDF content type - Used for serving PDF documents. * Example: A server sends a PDF invoice to the client. * @type {string} */ APPLICATION_PDF: 'application/pdf', /** * ZIP content type - Used for serving compressed ZIP files. * Example: A server provides a ZIP archive for a software download. * @type {string} */ APPLICATION_ZIP: 'application/zip', /** * GZIP content type - Used for serving compressed GZIP files. * Example: A server sends a GZIP-compressed log file. * @type {string} */ APPLICATION_GZIP: 'application/gzip', /** * Image PNG content type - Used for serving PNG image files. * Example: A server serves a PNG profile picture to a client. * @type {string} */ IMAGE_PNG: 'image/png', /** * Image JPEG content type - Used for serving JPEG image files. * Example: A server serves a JPEG photo to a web page. * @type {string} */ IMAGE_JPEG: 'image/jpeg', /** * Image GIF content type - Used for serving GIF image files. * Example: A server serves an animated GIF as a part of a webpage. * @type {string} */ IMAGE_GIF: 'image/gif', /** * Image BMP content type - Used for serving BMP image files. * Example: A server delivers a BMP file for specialized image processing. * @type {string} */ IMAGE_BMP: 'image/bmp', /** * Image SVG content type - Used for serving SVG vector graphics. * Example: A server serves an SVG logo to be displayed on a website. * @type {string} */ IMAGE_SVG_XML: 'image/svg+xml', /** * Audio MPEG content type - Used for serving MP3 audio files. * Example: A music streaming service delivers an MP3 file to a client. * @type {string} */ AUDIO_MPEG: 'audio/mpeg', /** * Audio OGG content type - Used for serving OGG audio files. * Example: A podcast server streams an OGG audio file. * @type {string} */ AUDIO_OGG: 'audio/ogg', /** * Video MP4 content type - Used for serving MP4 video files. * Example: A video streaming service provides an MP4 video file. * @type {string} */ VIDEO_MP4: 'video/mp4', /** * Video OGG content type - Used for serving OGG video files. * Example: A server streams an OGG video to a client. * @type {string} */ VIDEO_OGG: 'video/ogg', }; -
montasim created this gist
Jan 28, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,89 @@ /** * @fileoverview Defines the various content types used in the application. * This module exports an object that contains the different content types * the application can handle. These content types are used to configure * the application behavior based on the current content type. * * @module constants/contentTypes * @version 1.0.0 * @license MIT * * @contact Mohammad Montasim -Al- Mamun Shuvo * @created 2025-01-28 * @contactEmail [email protected] * @contactGithub https://github.com/montasim */ /** * An object representing different content types. * @enum {string} */ const contentTypesConstants = { /** JSON content type */ JSON: 'application/json', /** Form data content type */ FORM_DATA: 'multipart/form-data', /** URL encoded form data content type */ X_WWW_FORM_URLENCODED: 'application/x-www-form-urlencoded', /** Plain text content type */ TEXT_PLAIN: 'text/plain', /** HTML content type */ TEXT_HTML: 'text/html', /** XML content type */ APPLICATION_XML: 'application/xml', /** JavaScript content type */ APPLICATION_JAVASCRIPT: 'application/javascript', /** CSS content type */ TEXT_CSS: 'text/css', /** CSV content type */ TEXT_CSV: 'text/csv', /** Binary data content type */ APPLICATION_OCTET_STREAM: 'application/octet-stream', /** PDF content type */ APPLICATION_PDF: 'application/pdf', /** ZIP content type */ APPLICATION_ZIP: 'application/zip', /** GZIP content type */ APPLICATION_GZIP: 'application/gzip', /** Image PNG content type */ IMAGE_PNG: 'image/png', /** Image JPEG content type */ IMAGE_JPEG: 'image/jpeg', /** Image GIF content type */ IMAGE_GIF: 'image/gif', /** Image BMP content type */ IMAGE_BMP: 'image/bmp', /** Image SVG content type */ IMAGE_SVG_XML: 'image/svg+xml', /** Audio MPEG content type */ AUDIO_MPEG: 'audio/mpeg', /** Audio OGG content type */ AUDIO_OGG: 'audio/ogg', /** Video MP4 content type */ VIDEO_MP4: 'video/mp4', /** Video OGG content type */ VIDEO_OGG: 'video/ogg', }; export default contentTypesConstants;