001package com.nimbusds.oauth2.sdk.http;
002
003
004import javax.mail.internet.ContentType;
005import javax.mail.internet.ParameterList;
006
007
008/**
009 * Common content types used in the OAuth 2.0 protocol and implementing 
010 * applications. The character set all of content types is set to 
011 * {@link #DEFAULT_CHARSET UTF-8}.
012 */
013public final class CommonContentTypes {
014
015
016        /**
017         * The default character set.
018         */
019        public static final String DEFAULT_CHARSET = "UTF-8";
020
021
022        /**
023         * The default content type parameter list.
024         */
025        private static final ParameterList PARAM_LIST = new ParameterList();
026
027
028        /**
029         * Content type {@code application/json}.
030         */
031        public static final ContentType APPLICATION_JSON = new ContentType("application", "json", PARAM_LIST);
032        
033        
034        /**
035         * Content type {@code application/jwt}.
036         */
037        public static final ContentType APPLICATION_JWT = new ContentType("application", "jwt", PARAM_LIST);
038        
039        
040        /**
041         * Content type {@code application/x-www-form-urlencoded}.
042         */
043        public static final ContentType APPLICATION_URLENCODED = new ContentType("application", "x-www-form-urlencoded", PARAM_LIST);
044
045
046        static {
047                PARAM_LIST.set("charset", DEFAULT_CHARSET);
048        }
049}