Content Types

Content Type refers to the format and structure of the data being sent or received as part of a message, while connector types and protocols determine how the message is transmitted from one system to another.

The relationship between content types and connector types/protocols comes into play when sending or receiving messages. For example, if you want to send a message containing JSON data over HTTP, you would need to use an HTTP connector and set the content type of the message to application/json so that the receiving system knows how to interpret the data.



GLU connectors support various content types for messages, which can be specified using the Content-Type selector. The following are the content types that GLU supports:

  • text/plain
  • application/xml
  • application/json
  • application/octet-stream
  • multipart/form-data
  • application/x-www-form-urlencoded
  • application/soap+xml
  • application/atom+xml
  • application/rss+xml
  • application/pdf
  • text/xml; charset=UTF-8
  • application/xml; charset=UTF-8
  • application/jose

text/plain

This is used for plain text messages like emails or SMS.

application/xml

This is used for XML documents used in data exchange. It can be specified as application/xml or text/xml. In GLU, you can use either of these to specify the content type of XML documents being sent as part of a message to an external system or API. The application/xml type is more commonly used, and it indicates that the content of the message is an XML document. The text/xml type is also valid, but it is less commonly used and has the same semantics as application/xml.

application/json

This is used for JSON documents, commonly used for data exchange.

application/octet-stream

This is used for binary data like images or audio files.

multipart/form-data

This is used for submitting data including binary data, like file uploads.

application/x-www-form-urlencoded

This is used for submitting form data encoded as key-value pairs, similar to how HTML form submissions are handled. It’s important to note that parameters included in this content type cannot contain special characters. In order to encode these, you can apply the following function to the parameters before sending them on an outbound request. 

Note: All body parameters must be included in the request template, separated by the “&” delimiter, with no spaces between parameters and the delimiter.

application/soap+xml

This is for SOAP messages, commonly used in web services communication.

application/atom+xml

This for Atom feeds used to syndicate web content.

application/rss+xml

This is for RSS feeds used to syndicate web content.

application/pdf

This is used for PDF documents that is a popular file format used for document exchange, widely supported by various software applications and platforms. In GLU, you can use the application/pdf content type to send PDF documents as part of a message to an external system or API.

text/xml; charset=UTF-8

This means that the message contains XML documents encoded in the UTF-8 character set. When we use the text/xml media type, it’s a way of saying that the XML document is treated as plain text. We specify the character encoding of the document using the charset parameter. However, it’s more common to use the application/xml content type to indicate an XML document, and you can still specify the character encoding using the charset parameter. So, application/xml; charset=UTF-8 is another way of indicating that the message contains an XML document encoded in UTF-8.

application/xml; charset=UTF-8

Is a valid content type that indicates that the content of the message is an XML document encoded in the UTF-8 character set. The application/xml media type is used to indicate that the content of the message is an XML document, and the charset parameter is used to specify the character encoding of the document.

application/jose

application/jose is a recognized content type designed for handling encrypted and/or signed JSON data. JOSE (JSON Object Signing and Encryption) comprises a set of standards defining methods to secure data using JSON format. It facilitates digital signing, encryption, and authentication of JSON data, enhancing security for inter-system and inter-service communications. In GLU, application/jose serves as the content type for transmitting and receiving JOSE-formatted messages. GLU effectively manages JSON Web Tokens (JWTs) and JSON Web Encryption (JWE) messages. It supports tasks like JWT creation, verification, and decoding, as well as encryption and decryption of JWE messages. When dealing with signed messages, the “alg” parameter specifies the signing algorithm, while for encrypted messages, the “enc” parameter indicates the encryption algorithm in use.

It’s important to note that there are several other media types associated with JOSE, including application/jwt for JSON Web Tokens, application/jwe for JSON Web Encryption, and application/jws for JSON Web Signatures. These media types are utilised to denote specific types of JOSE messages and may include additional parameters for specifying algorithms and other metadata.






Was this article helpful?

Related Articles

Fill the form and we’ll contact you shortly

    I agree with

    cookies
    We uses cookies to make your experience on this website better. Learn more
    Accept cookies